diff options
author | oliviert | 2016-12-06 21:38:10 +0000 |
---|---|---|
committer | Markus Keller | 2016-12-19 21:45:24 +0000 |
commit | e11f7938c07dc50c5370136649c39b3e838b3c30 (patch) | |
tree | 677c87d457d26c9f01e7e0ff019125dcb5ae7121 | |
parent | 0f57bbb1450a35fae6dc9adafd1ec253aa707d52 (diff) | |
download | eclipse.jdt.ui-e11f7938c07dc50c5370136649c39b3e838b3c30.tar.gz eclipse.jdt.ui-e11f7938c07dc50c5370136649c39b3e838b3c30.tar.xz eclipse.jdt.ui-e11f7938c07dc50c5370136649c39b3e838b3c30.zip |
Bug 508777: Move some org.eclipse.jdt.internal.corext packages/types to org.eclipse.jdt.core.manipulation bundleI20161221-0400I20161220-2000I20161220-0530I20161219-2000
Change-Id: I7f0bf0a57bf8657eb2257ac63940c4caa25c1350
Signed-off-by: oliviert <Olivier_Thomann@ca.ibm.com>
Also-by: Markus Keller <markus_keller@ch.ibm.com>
410 files changed, 3145 insertions, 2914 deletions
diff --git a/org.eclipse.jdt.core.manipulation/.classpath b/org.eclipse.jdt.core.manipulation/.classpath index 4951124500..69a9e7e6db 100644 --- a/org.eclipse.jdt.core.manipulation/.classpath +++ b/org.eclipse.jdt.core.manipulation/.classpath @@ -4,5 +4,6 @@ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="refactoring"/> <classpathentry kind="src" path="common"/> + <classpathentry kind="src" path="core extension"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/org.eclipse.jdt.core.manipulation/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jdt.core.manipulation/.settings/org.eclipse.jdt.core.prefs index 88a5e89b79..59531d5963 100644 --- a/org.eclipse.jdt.core.manipulation/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jdt.core.manipulation/.settings/org.eclipse.jdt.core.prefs @@ -21,8 +21,11 @@ org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull +org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate @@ -84,12 +87,14 @@ org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning +org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error org.eclipse.jdt.core.compiler.problem.nullReference=error org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=error org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error org.eclipse.jdt.core.compiler.problem.potentialNullReference=info org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=info @@ -107,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=info diff --git a/org.eclipse.jdt.core.manipulation/META-INF/MANIFEST.MF b/org.eclipse.jdt.core.manipulation/META-INF/MANIFEST.MF index 7c07803e32..16c33b5475 100644 --- a/org.eclipse.jdt.core.manipulation/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.core.manipulation/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.jdt.core.manipulation; singleton:=true -Bundle-Version: 1.8.0.qualifier +Bundle-Version: 1.9.0.qualifier Bundle-Vendor: %providerName Bundle-Activator: org.eclipse.jdt.internal.core.manipulation.JavaManipulationPlugin Bundle-Localization: plugin @@ -11,13 +11,23 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.11.0,4.0.0)", org.eclipse.ltk.core.refactoring;bundle-version="[3.6.0,4.0.0)", org.eclipse.jdt.core;bundle-version="[3.8.0,4.0.0)", org.eclipse.core.expressions;bundle-version="[3.4.100,4.0.0)", - org.eclipse.text;bundle-version="[3.5.0,4.0.0)" + org.eclipse.text;bundle-version="[3.5.0,4.0.0)", + org.eclipse.jdt.launching;bundle-version="3.9.0" Bundle-ActivationPolicy: lazy Export-Package: org.eclipse.jdt.core.manipulation, org.eclipse.jdt.core.refactoring, org.eclipse.jdt.core.refactoring.descriptors, org.eclipse.jdt.core.refactoring.participants, org.eclipse.jdt.internal.core.manipulation;x-internal:=true, - org.eclipse.jdt.internal.core.refactoring.descriptors;x-friends:="org.eclipse.jdt.ui" + org.eclipse.jdt.internal.core.manipulation.dom;x-friends:="org.eclipse.jdt.ui", + org.eclipse.jdt.internal.core.manipulation.search;x-friends:="org.eclipse.jdt.ui,org.eclipse.jdt.text.tests", + org.eclipse.jdt.internal.core.manipulation.util;x-friends:="org.eclipse.jdt.junit,org.eclipse.jdt.text.tests,org.eclipse.jdt.ui", + org.eclipse.jdt.internal.core.refactoring.descriptors;x-friends:="org.eclipse.jdt.ui", + org.eclipse.jdt.internal.corext.dom;manipulation=split;mandatory:=manipulation;x-friends:="org.eclipse.jdt.ui,org.eclipse.jdt.junit", + org.eclipse.jdt.internal.corext.refactoring.changes;manipulation=split;mandatory:=manipulation;x-friends:="org.eclipse.jdt.ui.examples.javafamily,org.eclipse.jdt.ui", + org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types;manipulation=split;mandatory:=manipulation;x-friends:="org.eclipse.jdt.ui", + org.eclipse.jdt.internal.corext.refactoring.util;manipulation=split;mandatory:=manipulation;x-friends:="org.eclipse.jdt.ui", + org.eclipse.jdt.internal.corext.template.java;manipulation=split;mandatory:=manipulation;x-friends:="org.eclipse.jdt.ui", + org.eclipse.jdt.internal.corext.util;manipulation=split;mandatory:=manipulation;x-friends:="org.eclipse.jdt.ui,org.eclipse.jdt.junit" Import-Package: com.ibm.icu.text Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/org.eclipse.jdt.core.manipulation/build.properties b/org.eclipse.jdt.core.manipulation/build.properties index 2a6fc11184..7aad6a2feb 100644 --- a/org.eclipse.jdt.core.manipulation/build.properties +++ b/org.eclipse.jdt.core.manipulation/build.properties @@ -18,4 +18,6 @@ src.includes = about.html,\ schema/ source.. = common/,\ - refactoring/ + refactoring/,\ + core extension/ +output.. = bin/ diff --git a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/dom/ASTResolving.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/dom/ASTResolving.java new file mode 100644 index 0000000000..893a993833 --- /dev/null +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/dom/ASTResolving.java @@ -0,0 +1,1013 @@ +/******************************************************************************* + * Copyright (c) 2000, 2016 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.internal.core.manipulation.dom; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.core.runtime.IProgressMonitor; + +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jdt.core.dom.AST; +import org.eclipse.jdt.core.dom.ASTNode; +import org.eclipse.jdt.core.dom.ASTParser; +import org.eclipse.jdt.core.dom.AbstractTypeDeclaration; +import org.eclipse.jdt.core.dom.Annotation; +import org.eclipse.jdt.core.dom.AnonymousClassDeclaration; +import org.eclipse.jdt.core.dom.ArrayAccess; +import org.eclipse.jdt.core.dom.ArrayCreation; +import org.eclipse.jdt.core.dom.ArrayInitializer; +import org.eclipse.jdt.core.dom.ArrayType; +import org.eclipse.jdt.core.dom.AssertStatement; +import org.eclipse.jdt.core.dom.Assignment; +import org.eclipse.jdt.core.dom.BodyDeclaration; +import org.eclipse.jdt.core.dom.CastExpression; +import org.eclipse.jdt.core.dom.ClassInstanceCreation; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.core.dom.ConditionalExpression; +import org.eclipse.jdt.core.dom.ConstructorInvocation; +import org.eclipse.jdt.core.dom.Expression; +import org.eclipse.jdt.core.dom.FieldAccess; +import org.eclipse.jdt.core.dom.FieldDeclaration; +import org.eclipse.jdt.core.dom.IBinding; +import org.eclipse.jdt.core.dom.IMethodBinding; +import org.eclipse.jdt.core.dom.ITypeBinding; +import org.eclipse.jdt.core.dom.IVariableBinding; +import org.eclipse.jdt.core.dom.InfixExpression; +import org.eclipse.jdt.core.dom.Initializer; +import org.eclipse.jdt.core.dom.InstanceofExpression; +import org.eclipse.jdt.core.dom.LambdaExpression; +import org.eclipse.jdt.core.dom.MemberValuePair; +import org.eclipse.jdt.core.dom.MethodDeclaration; +import org.eclipse.jdt.core.dom.MethodInvocation; +import org.eclipse.jdt.core.dom.Modifier; +import org.eclipse.jdt.core.dom.Name; +import org.eclipse.jdt.core.dom.NameQualifiedType; +import org.eclipse.jdt.core.dom.ParameterizedType; +import org.eclipse.jdt.core.dom.PrefixExpression; +import org.eclipse.jdt.core.dom.PrimitiveType; +import org.eclipse.jdt.core.dom.PrimitiveType.Code; +import org.eclipse.jdt.core.dom.QualifiedName; +import org.eclipse.jdt.core.dom.QualifiedType; +import org.eclipse.jdt.core.dom.SimpleName; +import org.eclipse.jdt.core.dom.SimpleType; +import org.eclipse.jdt.core.dom.SingleVariableDeclaration; +import org.eclipse.jdt.core.dom.Statement; +import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor; +import org.eclipse.jdt.core.dom.SuperConstructorInvocation; +import org.eclipse.jdt.core.dom.SuperMethodInvocation; +import org.eclipse.jdt.core.dom.SwitchCase; +import org.eclipse.jdt.core.dom.SwitchStatement; +import org.eclipse.jdt.core.dom.TagElement; +import org.eclipse.jdt.core.dom.TryStatement; +import org.eclipse.jdt.core.dom.Type; +import org.eclipse.jdt.core.dom.TypeLiteral; +import org.eclipse.jdt.core.dom.VariableDeclaration; +import org.eclipse.jdt.core.dom.VariableDeclarationExpression; +import org.eclipse.jdt.core.dom.VariableDeclarationFragment; +import org.eclipse.jdt.core.dom.VariableDeclarationStatement; +import org.eclipse.jdt.core.dom.WildcardType; + +import org.eclipse.jdt.internal.corext.dom.ASTNodes; +import org.eclipse.jdt.internal.corext.dom.Bindings; +import org.eclipse.jdt.internal.corext.dom.GenericVisitor; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.corext.dom.ScopeAnalyzer; +import org.eclipse.jdt.internal.corext.dom.TypeBindingVisitor; +import org.eclipse.jdt.internal.corext.util.JdtFlags; + +/** + * Helper methods to find AST nodes or bindings. + */ +// @see JDTUIHelperClasses +// @see org.eclipse.jdt.internal.ui.text.correction.ASTResolving (subclass of this one) +public class ASTResolving { + + public static ITypeBinding guessBindingForReference(ASTNode node) { + return Bindings.normalizeTypeBinding(getPossibleReferenceBinding(node)); + } + + private static ITypeBinding getPossibleReferenceBinding(ASTNode node) { + ASTNode parent= node.getParent(); + switch (parent.getNodeType()) { + case ASTNode.ASSIGNMENT: + Assignment assignment= (Assignment) parent; + if (node.equals(assignment.getLeftHandSide())) { + // field write access: xx= expression + return assignment.getRightHandSide().resolveTypeBinding(); + } + // read access + return assignment.getLeftHandSide().resolveTypeBinding(); + case ASTNode.INFIX_EXPRESSION: + InfixExpression infix= (InfixExpression) parent; + InfixExpression.Operator op= infix.getOperator(); + if (op == InfixExpression.Operator.CONDITIONAL_AND || op == InfixExpression.Operator.CONDITIONAL_OR) { + // boolean operation + return infix.getAST().resolveWellKnownType("boolean"); //$NON-NLS-1$ + } else if (op == InfixExpression.Operator.LEFT_SHIFT || op == InfixExpression.Operator.RIGHT_SHIFT_UNSIGNED || op == InfixExpression.Operator.RIGHT_SHIFT_SIGNED) { + // asymmetric operation + return infix.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ + } + if (node.equals(infix.getLeftOperand())) { + // xx operation expression + ITypeBinding rigthHandBinding= infix.getRightOperand().resolveTypeBinding(); + if (rigthHandBinding != null) { + return rigthHandBinding; + } + } else { + // expression operation xx + ITypeBinding leftHandBinding= infix.getLeftOperand().resolveTypeBinding(); + if (leftHandBinding != null) { + return leftHandBinding; + } + } + if (op != InfixExpression.Operator.EQUALS && op != InfixExpression.Operator.NOT_EQUALS) { + return infix.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ + } + break; + case ASTNode.INSTANCEOF_EXPRESSION: + InstanceofExpression instanceofExpression= (InstanceofExpression) parent; + return instanceofExpression.getRightOperand().resolveBinding(); + case ASTNode.VARIABLE_DECLARATION_FRAGMENT: + VariableDeclarationFragment frag= (VariableDeclarationFragment) parent; + if (frag.getInitializer().equals(node)) { + return frag.getName().resolveTypeBinding(); + } + break; + case ASTNode.SUPER_METHOD_INVOCATION: + SuperMethodInvocation superMethodInvocation= (SuperMethodInvocation) parent; + IMethodBinding superMethodBinding= ASTNodes.getMethodBinding(superMethodInvocation.getName()); + if (superMethodBinding != null) { + return getParameterTypeBinding(node, superMethodInvocation.arguments(), superMethodBinding); + } + break; + case ASTNode.METHOD_INVOCATION: + MethodInvocation methodInvocation= (MethodInvocation) parent; + IMethodBinding methodBinding= methodInvocation.resolveMethodBinding(); + if (methodBinding != null) { + return getParameterTypeBinding(node, methodInvocation.arguments(), methodBinding); + } + break; + case ASTNode.SUPER_CONSTRUCTOR_INVOCATION: { + SuperConstructorInvocation superInvocation= (SuperConstructorInvocation) parent; + IMethodBinding superBinding= superInvocation.resolveConstructorBinding(); + if (superBinding != null) { + return getParameterTypeBinding(node, superInvocation.arguments(), superBinding); + } + break; + } + case ASTNode.CONSTRUCTOR_INVOCATION: { + ConstructorInvocation constrInvocation= (ConstructorInvocation) parent; + IMethodBinding constrBinding= constrInvocation.resolveConstructorBinding(); + if (constrBinding != null) { + return getParameterTypeBinding(node, constrInvocation.arguments(), constrBinding); + } + break; + } + case ASTNode.CLASS_INSTANCE_CREATION: { + ClassInstanceCreation creation= (ClassInstanceCreation) parent; + IMethodBinding creationBinding= creation.resolveConstructorBinding(); + if (creationBinding != null) { + return getParameterTypeBinding(node, creation.arguments(), creationBinding); + } + break; + } + case ASTNode.PARENTHESIZED_EXPRESSION: + return guessBindingForReference(parent); + case ASTNode.ARRAY_ACCESS: + if (((ArrayAccess) parent).getIndex().equals(node)) { + return parent.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ + } else { + ITypeBinding parentBinding= getPossibleReferenceBinding(parent); + if (parentBinding == null) { + parentBinding= parent.getAST().resolveWellKnownType("java.lang.Object"); //$NON-NLS-1$ + } + return parentBinding.createArrayType(1); + } + case ASTNode.ARRAY_CREATION: + if (((ArrayCreation) parent).dimensions().contains(node)) { + return parent.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ + } + break; + case ASTNode.ARRAY_INITIALIZER: + ASTNode initializerParent= parent.getParent(); + int dim= 1; + while (initializerParent instanceof ArrayInitializer) { + initializerParent= initializerParent.getParent(); + dim++; + } + Type creationType= null; + if (initializerParent instanceof ArrayCreation) { + creationType= ((ArrayCreation) initializerParent).getType(); + } else if (initializerParent instanceof VariableDeclaration) { + VariableDeclaration varDecl= (VariableDeclaration) initializerParent; + creationType= ASTNodes.getType(varDecl); + dim-= varDecl.getExtraDimensions(); + } else if (initializerParent instanceof MemberValuePair) { + String name= ((MemberValuePair) initializerParent).getName().getIdentifier(); + IMethodBinding annotMember= findAnnotationMember((Annotation) initializerParent.getParent(), name); + if (annotMember != null) { + return getReducedDimensionBinding(annotMember.getReturnType(), dim); + } + } + if (creationType instanceof ArrayType) { + ITypeBinding creationTypeBinding= ((ArrayType) creationType).resolveBinding(); + if (creationTypeBinding != null) { + return Bindings.getComponentType(creationTypeBinding, dim); + } + } + break; + case ASTNode.CONDITIONAL_EXPRESSION: + ConditionalExpression expression= (ConditionalExpression) parent; + if (node.equals(expression.getExpression())) { + return parent.getAST().resolveWellKnownType("boolean"); //$NON-NLS-1$ + } + if (node.equals(expression.getElseExpression())) { + return expression.getThenExpression().resolveTypeBinding(); + } + return expression.getElseExpression().resolveTypeBinding(); + case ASTNode.POSTFIX_EXPRESSION: + return parent.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ + case ASTNode.PREFIX_EXPRESSION: + if (((PrefixExpression) parent).getOperator() == PrefixExpression.Operator.NOT) { + return parent.getAST().resolveWellKnownType("boolean"); //$NON-NLS-1$ + } + return parent.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ + case ASTNode.IF_STATEMENT: + case ASTNode.WHILE_STATEMENT: + case ASTNode.DO_STATEMENT: + if (node instanceof Expression) { + return parent.getAST().resolveWellKnownType("boolean"); //$NON-NLS-1$ + } + break; + case ASTNode.SWITCH_STATEMENT: + if (((SwitchStatement) parent).getExpression().equals(node)) { + return parent.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ + } + break; + case ASTNode.RETURN_STATEMENT: + MethodDeclaration decl= findParentMethodDeclaration(parent); + if (decl != null && !decl.isConstructor()) { + return decl.getReturnType2().resolveBinding(); + } + LambdaExpression lambdaExpr= findEnclosingLambdaExpression(parent); + if (lambdaExpr != null) { + IMethodBinding lambdaMethodBinding= lambdaExpr.resolveMethodBinding(); + if (lambdaMethodBinding != null && lambdaMethodBinding.getReturnType() != null) { + return lambdaMethodBinding.getReturnType(); + } + } + break; + case ASTNode.CAST_EXPRESSION: + return ((CastExpression) parent).getType().resolveBinding(); + case ASTNode.THROW_STATEMENT: + case ASTNode.CATCH_CLAUSE: + return parent.getAST().resolveWellKnownType("java.lang.Exception"); //$NON-NLS-1$ + case ASTNode.FIELD_ACCESS: + if (node.equals(((FieldAccess) parent).getName())) { + return getPossibleReferenceBinding(parent); + } + break; + case ASTNode.SUPER_FIELD_ACCESS: + return getPossibleReferenceBinding(parent); + case ASTNode.QUALIFIED_NAME: + if (node.equals(((QualifiedName) parent).getName())) { + return getPossibleReferenceBinding(parent); + } + break; + case ASTNode.SWITCH_CASE: + if (node.equals(((SwitchCase) parent).getExpression()) && parent.getParent() instanceof SwitchStatement) { + return ((SwitchStatement) parent.getParent()).getExpression().resolveTypeBinding(); + } + break; + case ASTNode.ASSERT_STATEMENT: + if (node.getLocationInParent() == AssertStatement.EXPRESSION_PROPERTY) { + return parent.getAST().resolveWellKnownType("boolean"); //$NON-NLS-1$ + } + return parent.getAST().resolveWellKnownType("java.lang.String"); //$NON-NLS-1$ + case ASTNode.SINGLE_MEMBER_ANNOTATION: { + IMethodBinding annotMember= findAnnotationMember((Annotation) parent, "value"); //$NON-NLS-1$ + if (annotMember != null) { + return annotMember.getReturnType(); + } + break; + } + case ASTNode.MEMBER_VALUE_PAIR: { + String name= ((MemberValuePair) parent).getName().getIdentifier(); + IMethodBinding annotMember= findAnnotationMember((Annotation) parent.getParent(), name); + if (annotMember != null) { + return annotMember.getReturnType(); + } + break; + } + default: + // do nothing + } + + return null; + } + + public static IMethodBinding findAnnotationMember(Annotation annotation, String name) { + ITypeBinding annotBinding= annotation.resolveTypeBinding(); + if (annotBinding != null) { + return Bindings.findMethodInType(annotBinding, name, (String[]) null); + } + return null; + } + + public static ITypeBinding getReducedDimensionBinding(ITypeBinding arrayBinding, int dimsToReduce) { + while (dimsToReduce > 0) { + arrayBinding= arrayBinding.getComponentType(); + dimsToReduce--; + } + return arrayBinding; + } + + public static ITypeBinding getParameterTypeBinding(ASTNode node, List<Expression> args, IMethodBinding binding) { + int index= args.indexOf(node); + return getParameterTypeBinding(binding, index); + } + + public static ITypeBinding getParameterTypeBinding(IMethodBinding methodBinding, int argumentIndex) { + ITypeBinding[] paramTypes= methodBinding.getParameterTypes(); + if (methodBinding.isVarargs() && argumentIndex >= paramTypes.length - 1) { + return paramTypes[paramTypes.length - 1].getComponentType(); + } + if (argumentIndex >= 0 && argumentIndex < paramTypes.length) { + return paramTypes[argumentIndex]; + } + return null; + } + + public static ITypeBinding guessBindingForTypeReference(ASTNode node) { + StructuralPropertyDescriptor locationInParent= node.getLocationInParent(); + if (locationInParent == QualifiedName.QUALIFIER_PROPERTY) { + return null; // can't guess type for X.A + } + if (locationInParent == SimpleType.NAME_PROPERTY || + locationInParent == NameQualifiedType.NAME_PROPERTY) { + node= node.getParent(); + } + ITypeBinding binding= Bindings.normalizeTypeBinding(getPossibleTypeBinding(node)); + if (binding != null) { + if (binding.isWildcardType()) { + return normalizeWildcardType(binding, true, node.getAST()); + } + } + return binding; + } + + private static ITypeBinding getPossibleTypeBinding(ASTNode node) { + ASTNode parent= node.getParent(); + switch (parent.getNodeType()) { + case ASTNode.ARRAY_TYPE: { + int dim= ((ArrayType) parent).getDimensions(); + ITypeBinding parentBinding= getPossibleTypeBinding(parent); + if (parentBinding != null && parentBinding.getDimensions() == dim) { + return parentBinding.getElementType(); + } + return null; + } + case ASTNode.PARAMETERIZED_TYPE: { + ITypeBinding parentBinding= getPossibleTypeBinding(parent); + if (parentBinding == null || !parentBinding.isParameterizedType()) { + return null; + } + if (node.getLocationInParent() == ParameterizedType.TYPE_PROPERTY) { + return parentBinding; + } + + ITypeBinding[] typeArguments= parentBinding.getTypeArguments(); + List<Type> argumentNodes= ((ParameterizedType) parent).typeArguments(); + int index= argumentNodes.indexOf(node); + if (index != -1 && typeArguments.length == argumentNodes.size()) { + return typeArguments[index]; + } + return null; + } + case ASTNode.WILDCARD_TYPE: { + ITypeBinding parentBinding= getPossibleTypeBinding(parent); + if (parentBinding == null || !parentBinding.isWildcardType()) { + return null; + } + WildcardType wildcardType= (WildcardType) parent; + if (parentBinding.isUpperbound() == wildcardType.isUpperBound()) { + return parentBinding.getBound(); + } + return null; + } + case ASTNode.QUALIFIED_TYPE: { + ITypeBinding parentBinding= getPossibleTypeBinding(parent); + if (parentBinding == null || !parentBinding.isMember()) { + return null; + } + if (node.getLocationInParent() == QualifiedType.QUALIFIER_PROPERTY) { + return parentBinding.getDeclaringClass(); + } + return parentBinding; + } + case ASTNode.NAME_QUALIFIED_TYPE: { + ITypeBinding parentBinding= getPossibleTypeBinding(parent); + if (parentBinding == null || !parentBinding.isMember()) { + return null; + } + if (node.getLocationInParent() == NameQualifiedType.QUALIFIER_PROPERTY) { + return parentBinding.getDeclaringClass(); + } + return parentBinding; + } + case ASTNode.VARIABLE_DECLARATION_STATEMENT: + return guessVariableType(((VariableDeclarationStatement) parent).fragments()); + case ASTNode.FIELD_DECLARATION: + return guessVariableType(((FieldDeclaration) parent).fragments()); + case ASTNode.VARIABLE_DECLARATION_EXPRESSION: + return guessVariableType(((VariableDeclarationExpression) parent).fragments()); + case ASTNode.SINGLE_VARIABLE_DECLARATION: + SingleVariableDeclaration varDecl= (SingleVariableDeclaration) parent; + if (varDecl.getInitializer() != null) { + return Bindings.normalizeTypeBinding(varDecl.getInitializer().resolveTypeBinding()); + } + break; + case ASTNode.ARRAY_CREATION: + ArrayCreation creation= (ArrayCreation) parent; + if (creation.getInitializer() != null) { + return creation.getInitializer().resolveTypeBinding(); + } + return getPossibleReferenceBinding(parent); + case ASTNode.TYPE_LITERAL: + return ((TypeLiteral) parent).getType().resolveBinding(); + case ASTNode.CLASS_INSTANCE_CREATION: + return getPossibleReferenceBinding(parent); + case ASTNode.CAST_EXPRESSION: + return getPossibleReferenceBinding(parent); + case ASTNode.TAG_ELEMENT: + TagElement tagElement= (TagElement) parent; + if (TagElement.TAG_THROWS.equals(tagElement.getTagName()) || TagElement.TAG_EXCEPTION.equals(tagElement.getTagName())) { + ASTNode methNode= tagElement.getParent().getParent(); + if (methNode instanceof MethodDeclaration) { + List<Type> thrownExceptions= ((MethodDeclaration) methNode).thrownExceptionTypes(); + if (thrownExceptions.size() == 1) { + return thrownExceptions.get(0).resolveBinding(); + } + } + } + break; + } + return null; + } + + public static ITypeBinding guessVariableType(List<VariableDeclarationFragment> fragments) { + for (Iterator<VariableDeclarationFragment> iter= fragments.iterator(); iter.hasNext();) { + VariableDeclarationFragment frag= iter.next(); + if (frag.getInitializer() != null) { + return Bindings.normalizeTypeBinding(frag.getInitializer().resolveTypeBinding()); + } + } + return null; + } + + /** + * Finds all type bindings that contain a method of a given signature + * @param searchRoot the ast node to start the search from + * @param selector the method name + * @param arguments the method arguments + * @param context the context in which the method would be called + * @return returns all types known in the AST that have a method with a given name + */ + public static ITypeBinding[] getQualifierGuess(ASTNode searchRoot, final String selector, List<Expression> arguments, final IBinding context) { + final int nArgs= arguments.size(); + final ArrayList<ITypeBinding> result= new ArrayList<>(); + + // test if selector is a object method + ITypeBinding binding= searchRoot.getAST().resolveWellKnownType("java.lang.Object"); //$NON-NLS-1$ + IMethodBinding[] objectMethods= binding.getDeclaredMethods(); + for (int i= 0; i < objectMethods.length; i++) { + IMethodBinding meth= objectMethods[i]; + if (meth.getName().equals(selector) && meth.getParameterTypes().length == nArgs) { + return new ITypeBinding[] { binding }; + } + } + + visitAllBindings(searchRoot, new TypeBindingVisitor() { + private HashSet<String> fVisitedBindings= new HashSet<>(100); + + @Override + public boolean visit(ITypeBinding node) { + node= Bindings.normalizeTypeBinding(node); + if (node == null) { + return true; + } + + if (!fVisitedBindings.add(node.getKey())) { + return true; + } + if (node.isGenericType()) { + return true; // only look at parameterized types + } + if (context != null && !isUseableTypeInContext(node, context, false)) { + return true; + } + + IMethodBinding[] methods= node.getDeclaredMethods(); + for (int i= 0; i < methods.length; i++) { + IMethodBinding meth= methods[i]; + if (meth.getName().equals(selector) && meth.getParameterTypes().length == nArgs) { + result.add(node); + } + } + return true; + } + }); + return result.toArray(new ITypeBinding[result.size()]); + } + + public static void visitAllBindings(ASTNode astRoot, TypeBindingVisitor visitor) { + try { + astRoot.accept(new AllBindingsVisitor(visitor)); + } catch (AllBindingsVisitor.VisitCancelledException e) { + // visit cancelled + } + } + + private static class AllBindingsVisitor extends GenericVisitor { + private final TypeBindingVisitor fVisitor; + + private static class VisitCancelledException extends RuntimeException { + private static final long serialVersionUID= 1L; + } + public AllBindingsVisitor(TypeBindingVisitor visitor) { + super(true); + fVisitor= visitor; + } + @Override + public boolean visit(SimpleName node) { + ITypeBinding binding= node.resolveTypeBinding(); + if (binding != null) { + boolean res= fVisitor.visit(binding); + if (res) { + res= Bindings.visitHierarchy(binding, fVisitor); + } + if (!res) { + throw new VisitCancelledException(); + } + } + return false; + } + } + + + public static IBinding getParentMethodOrTypeBinding(ASTNode node) { + do { + if (node instanceof MethodDeclaration) { + return ((MethodDeclaration) node).resolveBinding(); + } else if (node instanceof AbstractTypeDeclaration) { + return ((AbstractTypeDeclaration) node).resolveBinding(); + } else if (node instanceof AnonymousClassDeclaration) { + return ((AnonymousClassDeclaration) node).resolveBinding(); + } + node= node.getParent(); + } while (node != null); + + return null; + } + + public static BodyDeclaration findParentBodyDeclaration(ASTNode node) { + while ((node != null) && (!(node instanceof BodyDeclaration))) { + node= node.getParent(); + } + return (BodyDeclaration) node; + } + + public static BodyDeclaration findParentBodyDeclaration(ASTNode node, boolean treatModifiersOutside) { + StructuralPropertyDescriptor lastLocation= null; + + while (node != null) { + if (node instanceof BodyDeclaration) { + BodyDeclaration decl= (BodyDeclaration) node; + if (!treatModifiersOutside || lastLocation != decl.getModifiersProperty()) { + return decl; + } + treatModifiersOutside= false; + } + lastLocation= node.getLocationInParent(); + node= node.getParent(); + } + return (BodyDeclaration) node; + } + + + public static CompilationUnit findParentCompilationUnit(ASTNode node) { + return (CompilationUnit) findAncestor(node, ASTNode.COMPILATION_UNIT); + } + + /** + * Finds the ancestor type of <code>node</code> (includes <code>node</code> in the search). + * + * @param node the node to start the search from, can be <code>null</code> + * @param treatModifiersOutside if set, modifiers are not part of their type, but of the type's + * parent + * @return returns the ancestor type of <code>node</code> (AbstractTypeDeclaration or + * AnonymousTypeDeclaration) if any (including <code>node</code>), <code>null</code> + * otherwise + */ + public static ASTNode findParentType(ASTNode node, boolean treatModifiersOutside) { + StructuralPropertyDescriptor lastLocation= null; + + while (node != null) { + if (node instanceof AbstractTypeDeclaration) { + AbstractTypeDeclaration decl= (AbstractTypeDeclaration) node; + if (!treatModifiersOutside || lastLocation != decl.getModifiersProperty()) { + return decl; + } + } else if (node instanceof AnonymousClassDeclaration) { + return node; + } + lastLocation= node.getLocationInParent(); + node= node.getParent(); + } + return null; + } + + /** + * Finds the ancestor type of <code>node</code> (includes <code>node</code> in the search). + * + * @param node the node to start the search from, can be <code>null</code> + * @return returns the ancestor type of <code>node</code> (AbstractTypeDeclaration or + * AnonymousTypeDeclaration) if any (including <code>node</code>), <code>null</code> + * otherwise + */ + public static ASTNode findParentType(ASTNode node) { + return findParentType(node, false); + } + + /** + * The node's enclosing method declaration or <code>null</code> if + * the node is not inside a method and is not a method declaration itself. + * + * @param node a node + * @return the enclosing method declaration or <code>null</code> + */ + public static MethodDeclaration findParentMethodDeclaration(ASTNode node) { + while (node != null) { + if (node instanceof MethodDeclaration) { + return (MethodDeclaration) node; + } else if (node instanceof BodyDeclaration || node instanceof AnonymousClassDeclaration || node instanceof LambdaExpression) { + return null; + } + node= node.getParent(); + } + return null; + } + + /** + * Returns the lambda expression node which encloses the given <code>node</code>, or + * <code>null</code> if none. + * + * @param node the node + * @return the enclosing lambda expression node for the given <code>node</code>, or + * <code>null</code> if none + * + * @since 3.10 + */ + public static LambdaExpression findEnclosingLambdaExpression(ASTNode node) { + node= node.getParent(); + while (node != null) { + if (node instanceof LambdaExpression) { + return (LambdaExpression) node; + } + if (node instanceof BodyDeclaration || node instanceof AnonymousClassDeclaration) { + return null; + } + node= node.getParent(); + } + return null; + } + + /** + * Returns the closest ancestor of <code>node</code> (including <code>node</code> itself) + * whose type is <code>nodeType</code>, or <code>null</code> if none. + * <p> + * <b>Warning:</b> This method does not stop at any boundaries like parentheses, statements, body declarations, etc. + * The resulting node may be in a totally different scope than the given node. + * Consider using one of the other {@link ASTResolving}<code>.find(..)</code> methods instead. + * </p> + * @param node the node + * @param nodeType the node type constant from {@link ASTNode} + * @return the closest ancestor of <code>node</code> (including <code>node</code> itself) + * whose type is <code>nodeType</code>, or <code>null</code> if none + */ + public static ASTNode findAncestor(ASTNode node, int nodeType) { + while ((node != null) && (node.getNodeType() != nodeType)) { + node= node.getParent(); + } + return node; + } + + public static Statement findParentStatement(ASTNode node) { + while ((node != null) && (!(node instanceof Statement))) { + node= node.getParent(); + if (node instanceof BodyDeclaration) { + return null; + } + } + return (Statement) node; + } + + public static TryStatement findParentTryStatement(ASTNode node) { + while ((node != null) && (!(node instanceof TryStatement))) { + node= node.getParent(); + if (node instanceof BodyDeclaration || node instanceof LambdaExpression) { + return null; + } + } + return (TryStatement) node; + } + + public static boolean isInsideConstructorInvocation(MethodDeclaration methodDeclaration, ASTNode node) { + if (methodDeclaration.isConstructor()) { + Statement statement= findParentStatement(node); + if (statement instanceof ConstructorInvocation || statement instanceof SuperConstructorInvocation) { + return true; // argument in a this or super call + } + } + return false; + } + + public static boolean isInsideModifiers(ASTNode node) { + while (node != null && !(node instanceof BodyDeclaration)) { + if (node instanceof Annotation) { + return true; + } + node= node.getParent(); + } + return false; + } + + public static boolean isInStaticContext(ASTNode selectedNode) { + BodyDeclaration decl= findParentBodyDeclaration(selectedNode); + if (decl instanceof MethodDeclaration) { + if (isInsideConstructorInvocation((MethodDeclaration) decl, selectedNode)) { + return true; + } + return Modifier.isStatic(decl.getModifiers()); + } else if (decl instanceof Initializer) { + return Modifier.isStatic(((Initializer)decl).getModifiers()); + } else if (decl instanceof FieldDeclaration) { + return JdtFlags.isStatic(decl); + } + return false; + } + + public static boolean isWriteAccess(Name selectedNode) { + ASTNode curr= selectedNode; + ASTNode parent= curr.getParent(); + while (parent != null) { + switch (parent.getNodeType()) { + case ASTNode.QUALIFIED_NAME: + if (((QualifiedName) parent).getQualifier() == curr) { + return false; + } + break; + case ASTNode.FIELD_ACCESS: + if (((FieldAccess) parent).getExpression() == curr) { + return false; + } + break; + case ASTNode.SUPER_FIELD_ACCESS: + break; + case ASTNode.ASSIGNMENT: + return ((Assignment) parent).getLeftHandSide() == curr; + case ASTNode.VARIABLE_DECLARATION_FRAGMENT: + case ASTNode.SINGLE_VARIABLE_DECLARATION: + return ((VariableDeclaration) parent).getName() == curr; + case ASTNode.POSTFIX_EXPRESSION: + return true; + case ASTNode.PREFIX_EXPRESSION: + PrefixExpression.Operator op= ((PrefixExpression) parent).getOperator(); + return op == PrefixExpression.Operator.DECREMENT || op == PrefixExpression.Operator.INCREMENT; + default: + return false; + } + + curr= parent; + parent= curr.getParent(); + } + return false; + } + + public static String getFullName(Name name) { + return name.getFullyQualifiedName(); + } + + public static ICompilationUnit findCompilationUnitForBinding(ICompilationUnit cu, CompilationUnit astRoot, ITypeBinding binding) throws JavaModelException { + if (binding == null || !binding.isFromSource() || binding.isTypeVariable() || binding.isWildcardType()) { + return null; + } + ASTNode node= astRoot.findDeclaringNode(binding.getTypeDeclaration()); + if (node == null) { + ICompilationUnit targetCU= Bindings.findCompilationUnit(binding, cu.getJavaProject()); + if (targetCU != null) { + return targetCU; + } + return null; + } else if (node instanceof AbstractTypeDeclaration || node instanceof AnonymousClassDeclaration) { + return cu; + } + return null; + } + + + private static final Code[] CODE_ORDER= { PrimitiveType.CHAR, PrimitiveType.SHORT, PrimitiveType.INT, PrimitiveType.LONG, PrimitiveType.FLOAT, PrimitiveType.DOUBLE }; + + public static ITypeBinding[] getNarrowingTypes(AST ast, ITypeBinding type) { + ArrayList<ITypeBinding> res= new ArrayList<>(); + res.add(type); + if (type.isPrimitive()) { + Code code= PrimitiveType.toCode(type.getName()); + for (int i= 0; i < CODE_ORDER.length && code != CODE_ORDER[i]; i++) { + String typeName= CODE_ORDER[i].toString(); + res.add(ast.resolveWellKnownType(typeName)); + } + } + return res.toArray(new ITypeBinding[res.size()]); + } + + public static ITypeBinding[] getRelaxingTypes(AST ast, ITypeBinding type) { + ArrayList<ITypeBinding> res= new ArrayList<>(); + res.add(type); + if (type.isArray()) { + res.add(ast.resolveWellKnownType("java.lang.Object")); //$NON-NLS-1$ + // The following two types are not available in some j2me implementations, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=288060 : + ITypeBinding serializable= ast.resolveWellKnownType("java.io.Serializable"); //$NON-NLS-1$ + if (serializable != null) + res.add(serializable); + ITypeBinding cloneable= ast.resolveWellKnownType("java.lang.Cloneable"); //$NON-NLS-1$ + if (cloneable != null) + res.add(cloneable); + } else if (type.isPrimitive()) { + Code code= PrimitiveType.toCode(type.getName()); + boolean found= false; + for (int i= 0; i < CODE_ORDER.length; i++) { + if (found) { + String typeName= CODE_ORDER[i].toString(); + res.add(ast.resolveWellKnownType(typeName)); + } + if (code == CODE_ORDER[i]) { + found= true; + } + } + } else { + collectRelaxingTypes(res, type); + } + return res.toArray(new ITypeBinding[res.size()]); + } + + private static void collectRelaxingTypes(Collection<ITypeBinding> res, ITypeBinding type) { + ITypeBinding[] interfaces= type.getInterfaces(); + for (int i= 0; i < interfaces.length; i++) { + ITypeBinding curr= interfaces[i]; + if (!res.contains(curr)) { + res.add(curr); + } + collectRelaxingTypes(res, curr); + } + ITypeBinding binding= type.getSuperclass(); + if (binding != null) { + if (!res.contains(binding)) { + res.add(binding); + } + collectRelaxingTypes(res, binding); + } + } + + public static String[] getUsedVariableNames(ASTNode node) { + CompilationUnit root= (CompilationUnit) node.getRoot(); + Collection<String> res= (new ScopeAnalyzer(root)).getUsedVariableNames(node.getStartPosition(), node.getLength()); + return res.toArray(new String[res.size()]); + } + + private static boolean isVariableDefinedInContext(IBinding binding, ITypeBinding typeVariable) { + if (binding.getKind() == IBinding.VARIABLE) { + IVariableBinding var= (IVariableBinding) binding; + binding= var.getDeclaringMethod(); + if (binding == null) { + binding= var.getDeclaringClass(); + } + } + if (binding instanceof IMethodBinding) { + if (binding == typeVariable.getDeclaringMethod()) { + return true; + } + binding= ((IMethodBinding) binding).getDeclaringClass(); + } + + while (binding instanceof ITypeBinding) { + if (binding == typeVariable.getDeclaringClass()) { + return true; + } + if (Modifier.isStatic(binding.getModifiers())) { + break; + } + binding= ((ITypeBinding) binding).getDeclaringClass(); + } + return false; + } + + public static boolean isUseableTypeInContext(ITypeBinding type, IBinding context, boolean noWildcards) { + if (type.isArray()) { + type= type.getElementType(); + } + if (type.isAnonymous()) { + return false; + } + if (type.isRawType() || type.isPrimitive()) { + return true; + } + if (type.isTypeVariable()) { + return isVariableDefinedInContext(context, type); + } + if (type.isGenericType()) { + ITypeBinding[] typeParameters= type.getTypeParameters(); + for (int i= 0; i < typeParameters.length; i++) { + if (!isUseableTypeInContext(typeParameters[i], context, noWildcards)) { + return false; + } + } + return true; + } + if (type.isParameterizedType()) { + ITypeBinding[] typeArguments= type.getTypeArguments(); + for (int i= 0; i < typeArguments.length; i++) { + if (!isUseableTypeInContext(typeArguments[i], context, noWildcards)) { + return false; + } + } + return true; + } + if (type.isCapture()) { + type= type.getWildcard(); + } + + if (type.isWildcardType()) { + if (noWildcards) { + return false; + } + if (type.getBound() != null) { + return isUseableTypeInContext(type.getBound(), context, noWildcards); + } + } + return true; + } + + /** + * Use this method before creating a type for a wildcard. Either to assign a wildcard to a new type or for a type to be assigned. + * + * @param wildcardType the wildcard type to normalize + * @param isBindingToAssign if true, then the type X for new variable x is returned (X x= s); + * if false, the type of an expression x (R r= x) + * @param ast the current AST + * @return the normalized binding or null when only the 'null' binding + * + * @see Bindings#normalizeForDeclarationUse(ITypeBinding, AST) + */ + public static ITypeBinding normalizeWildcardType(ITypeBinding wildcardType, boolean isBindingToAssign, AST ast) { + ITypeBinding bound= wildcardType.getBound(); + if (isBindingToAssign) { + if (bound == null || !wildcardType.isUpperbound()) { + ITypeBinding[] typeBounds= wildcardType.getTypeBounds(); + if (typeBounds.length > 0) { + return typeBounds[0]; + } else { + return wildcardType.getErasure(); + } + } + } else { + if (bound == null || wildcardType.isUpperbound()) { + return null; + } + } + return bound; + } + + + public static CompilationUnit createQuickFixAST(ICompilationUnit compilationUnit, IProgressMonitor monitor) { + ASTParser astParser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); + astParser.setSource(compilationUnit); + astParser.setResolveBindings(true); + astParser.setStatementsRecovery(IASTSharedValues.SHARED_AST_STATEMENT_RECOVERY); + astParser.setBindingsRecovery(IASTSharedValues.SHARED_BINDING_RECOVERY); + return (CompilationUnit) astParser.createAST(monitor); + } +} diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/IOccurrencesFinder.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/search/IOccurrencesFinder.java index f4896291fa..55229fae4d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/IOccurrencesFinder.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/search/IOccurrencesFinder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,7 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -package org.eclipse.jdt.internal.ui.search; +package org.eclipse.jdt.internal.core.manipulation.search; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.CompilationUnit; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesFinder.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/search/OccurrencesFinder.java index 98d97e52a1..4fbbbb7f68 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesFinder.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/search/OccurrencesFinder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -8,7 +8,7 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ -package org.eclipse.jdt.internal.ui.search; +package org.eclipse.jdt.internal.core.manipulation.search; import java.util.ArrayList; import java.util.HashSet; @@ -44,11 +44,10 @@ import org.eclipse.jdt.core.dom.SingleVariableDeclaration; import org.eclipse.jdt.core.dom.Type; import org.eclipse.jdt.core.dom.VariableDeclarationFragment; +import org.eclipse.jdt.internal.core.manipulation.Messages; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; -import org.eclipse.jdt.internal.corext.util.Messages; - -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; public class OccurrencesFinder extends ASTVisitor implements IOccurrencesFinder { diff --git a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/search/SearchMessages.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/search/SearchMessages.java new file mode 100644 index 0000000000..c33886108f --- /dev/null +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/search/SearchMessages.java @@ -0,0 +1,35 @@ +/******************************************************************************* + * Copyright (c) 2000, 2016 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.internal.core.manipulation.search; + +import org.eclipse.osgi.util.NLS; + +public final class SearchMessages extends NLS { + + private static final String BUNDLE_NAME= "org.eclipse.jdt.internal.core.manipulation.search.SearchMessages";//$NON-NLS-1$ + + private SearchMessages() { + // Do not instantiate + } + + static { + NLS.initializeMessages(BUNDLE_NAME, SearchMessages.class); + } + + public static String OccurrencesFinder_no_element; + public static String OccurrencesFinder_no_binding; + public static String OccurrencesFinder_searchfor; + public static String OccurrencesFinder_label_singular; + public static String OccurrencesFinder_label_plural; + public static String OccurrencesFinder_occurrence_description; + public static String OccurrencesFinder_occurrence_write_description; + public static String OccurrencesSearchLabelProvider_line_number; +} diff --git a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/search/SearchMessages.properties b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/search/SearchMessages.properties new file mode 100644 index 0000000000..b77eaf47ee --- /dev/null +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/search/SearchMessages.properties @@ -0,0 +1,20 @@ +############################################################################### +# Copyright (c) 2000, 2016 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +OccurrencesFinder_no_element= Cannot search for the current selection. Please select a valid Java element name. +OccurrencesFinder_no_binding= Selected Java element is unknown. +OccurrencesFinder_searchfor=Search for Occurrences in File +# The first argument will be replaced by the element name and the second one by the file name +OccurrencesFinder_label_singular=''{0}'' - 1 occurrence in ''{1}'' +# The first argument will be replaced by the element name, the second by the count and the last by the file name +OccurrencesFinder_label_plural=''{0}'' - {1} occurrences in ''{2}'' +OccurrencesFinder_occurrence_description=Occurrence of ''{0}'' +OccurrencesFinder_occurrence_write_description=Write occurrence of ''{0}'' +OccurrencesSearchLabelProvider_line_number={0}: diff --git a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/util/BasicElementLabels.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/util/BasicElementLabels.java new file mode 100644 index 0000000000..c5e34e23c8 --- /dev/null +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/util/BasicElementLabels.java @@ -0,0 +1,147 @@ +/******************************************************************************* + * Copyright (c) 2016 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.internal.core.manipulation.util; + +import java.io.File; + +import org.eclipse.osgi.util.TextProcessor; + +import org.eclipse.core.runtime.IPath; + +import org.eclipse.core.resources.IResource; + +import org.eclipse.jdt.core.ITypeRoot; + +/** + * A label provider for basic elements like paths. The label provider will make sure that the labels are correctly + * shown in RTL environments. + */ +// @see JDTUIHelperClasses +// @see org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels (subclass of this one) +public class BasicElementLabels { + + + // TextProcessor delimiters + private static final String CODE_DELIMITERS= TextProcessor.getDefaultDelimiters() + "<>()?,{}+-*!%=^|&;[]~"; //$NON-NLS-1$ + private static final String FILE_PATTERN_DELIMITERS= TextProcessor.getDefaultDelimiters() + "*.?"; //$NON-NLS-1$ + private static final String URL_DELIMITERS= TextProcessor.getDefaultDelimiters() + ":@?-"; //$NON-NLS-1$ + + + /** + * Returns the label of a path. + * + * @param path the path + * @param isOSPath if <code>true</code>, the path represents an OS path, if <code>false</code> it is a workspace path. + * @return the label of the path to be used in the UI. + */ + public static String getPathLabel(IPath path, boolean isOSPath) { + String label; + if (isOSPath) { + label= path.toOSString(); + } else { + label= path.makeRelative().toString(); + } + return Strings.markLTR(label); + } + + /** + * Returns the label of the path of a file. + * + * @param file the file + * @return the label of the file path to be used in the UI. + */ + public static String getPathLabel(File file) { + return Strings.markLTR(file.getAbsolutePath()); + } + + /** + * Returns the label for a file pattern like '*.java' + * + * @param name the pattern + * @return the label of the pattern. + */ + public static String getFilePattern(String name) { + return Strings.markLTR(name, FILE_PATTERN_DELIMITERS); + } + + /** + * Returns the label for a URL, URI or URL part. Example is 'http://www.x.xom/s.html#1' + * + * @param name the URL string + * @return the label of the URL. + */ + public static String getURLPart(String name) { + return Strings.markLTR(name, URL_DELIMITERS); + } + + /** + * Returns a label for a resource name. + * + * @param resource the resource + * @return the label of the resource name. + */ + public static String getResourceName(IResource resource) { + return Strings.markLTR(resource.getName()); + } + + /** + * Returns a label for a resource name. + * + * @param resourceName the resource name + * @return the label of the resource name. + */ + public static String getResourceName(String resourceName) { + return Strings.markLTR(resourceName); + } + + /** + * Returns a label for a type root name which is a file name. + * + * @param typeRoot the typeRoot + * @return the label of the resource name. + */ + public static String getFileName(ITypeRoot typeRoot) { + return Strings.markLTR(typeRoot.getElementName()); + } + + /** + * Returns a label for Java element name. Example is 'new Test<? extends List>() { ...}'. + * This method should only be used for simple element names. Use + * org.eclipse.jdt.ui.JavaElementLabels to create a label from a Java element or + * org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider for labels of bindings. + * + * @param name the Java element name. + * @return the label for the Java element + */ + public static String getJavaElementName(String name) { + return Strings.markJavaElementLabelLTR(name); + } + + /** + * Returns a label for Java code snippet used in a label. Example is 'Test test= new Test<? extends List>() { ...}'. + * + * @param string the Java code snippet + * @return the label for the Java code snippet + */ + public static String getJavaCodeString(String string) { + return Strings.markLTR(string, CODE_DELIMITERS); + } + + /** + * Returns a label for a version name. Example is '1.4.1' + * + * @param name the version string + * @return the version label + */ + public static String getVersionName(String name) { + return Strings.markLTR(name); + } +} diff --git a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/util/Strings.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/util/Strings.java new file mode 100644 index 0000000000..c453d6a1fd --- /dev/null +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/core/manipulation/util/Strings.java @@ -0,0 +1,538 @@ +/******************************************************************************* + * Copyright (c) 2000, 2016 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.internal.core.manipulation.util; + +import org.eclipse.osgi.util.TextProcessor; + +import org.eclipse.core.runtime.Assert; + +import org.eclipse.jface.text.BadLocationException; +import org.eclipse.jface.text.DefaultLineTracker; +import org.eclipse.jface.text.ILineTracker; +import org.eclipse.jface.text.IRegion; + +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.formatter.IndentManipulation; + +import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil; + +/** + * Helper class to provide String manipulation functions not available in standard JDK. + */ +// @see JDTUIHelperClasses +// @see org.eclipse.jdt.internal.corext.util.Strings (subclass of this one) +public class Strings { + + protected Strings(){} + + + /** + * Tells whether we have to use the {@link TextProcessor} + * <p> + * This is used for performance optimization. + * </p> + * @since 3.4 + */ + public static final boolean USE_TEXT_PROCESSOR; + static { + String testString= "args : String[]"; //$NON-NLS-1$ + USE_TEXT_PROCESSOR= testString != TextProcessor.process(testString); + } + + protected static final String JAVA_ELEMENT_DELIMITERS= TextProcessor.getDefaultDelimiters() + "<>(),?{} "; //$NON-NLS-1$ + + /** + * Adds special marks so that that the given string is readable in a BiDi environment. + * + * @param string the string + * @return the processed styled string + * @since 3.4 + */ + public static String markLTR(String string) { + if (!USE_TEXT_PROCESSOR) + return string; + + return TextProcessor.process(string); + } + + /** + * Adds special marks so that that the given string is readable in a BiDi environment. + * + * @param string the string + * @param delimiters the delimiters + * @return the processed styled string + * @since 3.4 + */ + public static String markLTR(String string, String delimiters) { + if (!USE_TEXT_PROCESSOR) + return string; + + return TextProcessor.process(string, delimiters); + } + + /** + * Adds special marks so that that the given Java element label is readable in a BiDi + * environment. + * + * @param string the string + * @return the processed styled string + * @since 3.6 + */ + public static String markJavaElementLabelLTR(String string) { + if (!USE_TEXT_PROCESSOR) + return string; + + return TextProcessor.process(string, JAVA_ELEMENT_DELIMITERS); + } + + /** + * Tests if a char is lower case. Fix for 26529. + * @param ch the char + * @return return true if char is lower case + */ + public static boolean isLowerCase(char ch) { + return Character.toLowerCase(ch) == ch; + } + + public static boolean startsWithIgnoreCase(String text, String prefix) { + int textLength= text.length(); + int prefixLength= prefix.length(); + if (textLength < prefixLength) + return false; + for (int i= prefixLength - 1; i >= 0; i--) { + if (Character.toLowerCase(prefix.charAt(i)) != Character.toLowerCase(text.charAt(i))) + return false; + } + return true; + } + + public static String removeNewLine(String message) { + StringBuffer result= new StringBuffer(); + int current= 0; + int index= message.indexOf('\n', 0); + while (index != -1) { + result.append(message.substring(current, index)); + if (current < index && index != 0) + result.append(' '); + current= index + 1; + index= message.indexOf('\n', current); + } + result.append(message.substring(current)); + return result.toString(); + } + + /** + * Converts the given string into an array of lines. The lines + * don't contain any line delimiter characters. + * + * @param input the string + * @return the string converted into an array of strings. Returns <code> + * null</code> if the input string can't be converted in an array of lines. + */ + public static String[] convertIntoLines(String input) { + try { + ILineTracker tracker= new DefaultLineTracker(); + tracker.set(input); + int size= tracker.getNumberOfLines(); + String result[]= new String[size]; + for (int i= 0; i < size; i++) { + IRegion region= tracker.getLineInformation(i); + int offset= region.getOffset(); + result[i]= input.substring(offset, offset + region.getLength()); + } + return result; + } catch (BadLocationException e) { + return null; + } + } + + /** + * Returns <code>true</code> if the given string only consists of + * white spaces according to Java. If the string is empty, <code>true + * </code> is returned. + * + * @param s the string to test + * @return <code>true</code> if the string only consists of white + * spaces; otherwise <code>false</code> is returned + * + * @see java.lang.Character#isWhitespace(char) + */ + public static boolean containsOnlyWhitespaces(String s) { + int size= s.length(); + for (int i= 0; i < size; i++) { + if (!Character.isWhitespace(s.charAt(i))) + return false; + } + return true; + } + + /** + * Removes leading tabs and spaces from the given string. If the string + * doesn't contain any leading tabs or spaces then the string itself is + * returned. + * @param line the line + * @return the trimmed line + */ + public static String trimLeadingTabsAndSpaces(String line) { + int size= line.length(); + int start= size; + for (int i= 0; i < size; i++) { + char c= line.charAt(i); + if (!IndentManipulation.isIndentChar(c)) { + start= i; + break; + } + } + if (start == 0) + return line; + else if (start == size) + return ""; //$NON-NLS-1$ + else + return line.substring(start); + } + + public static String trimTrailingTabsAndSpaces(String line) { + int size= line.length(); + int end= size; + for (int i= size - 1; i >= 0; i--) { + char c= line.charAt(i); + if (IndentManipulation.isIndentChar(c)) { + end= i; + } else { + break; + } + } + if (end == size) + return line; + else if (end == 0) + return ""; //$NON-NLS-1$ + else + return line.substring(0, end); + } + + /** + * Returns the indent of the given string in indentation units. Odd spaces + * are not counted. + * + * @param line the text line + * @param project the java project from which to get the formatter + * preferences, or <code>null</code> for global preferences + * @return the number of indent units + * @since 3.1 + */ + public static int computeIndentUnits(String line, IJavaProject project) { + return IndentManipulation.measureIndentUnits(line, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); + } + + /** + * Returns the indent of the given string in indentation units. Odd spaces + * are not counted. + * + * @param line the text line + * @param tabWidth the width of the '\t' character in space equivalents + * @param indentWidth the width of one indentation unit in space equivalents + * @return the indent of the given string in indentation units + * + * @since 3.1 + */ + public static int computeIndentUnits(String line, int tabWidth, int indentWidth) { + return IndentManipulation.measureIndentUnits(line, tabWidth, indentWidth); + } + + /** + * Computes the visual length of the indentation of a + * <code>CharSequence</code>, counting a tab character as the size until + * the next tab stop and every other whitespace character as one. + * + * @param line the string to measure the indent of + * @param tabSize the visual size of a tab in space equivalents + * @return the visual length of the indentation of <code>line</code> + * @since 3.1 + */ + public static int measureIndentLength(CharSequence line, int tabSize) { + return IndentManipulation.measureIndentInSpaces(line, tabSize); + } + + /** + * Removes the given number of indents from the line. Asserts that the given line + * has the requested number of indents. If <code>indentsToRemove <= 0</code> + * the line is returned. + * @param line the line + * @param indentsToRemove the indents to remove + * + * @param project the java project from which to get the formatter + * preferences, or <code>null</code> for global preferences + * @return the trimmed line + * + * @since 3.1 + */ + public static String trimIndent(String line, int indentsToRemove, IJavaProject project) { + return IndentManipulation.trimIndent(line, indentsToRemove, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); + } + + /** + * Removes the given number of indents from the line. Asserts that the given line + * has the requested number of indents. If <code>indentsToRemove <= 0</code> + * the line is returned. + * @param line the line + * @param indentsToRemove the indents to remove + * @param tabWidth the tab width + * @param indentWidth the indent width + * @return the trimmed line + * + * @since 3.1 + */ + public static String trimIndent(String line, int indentsToRemove, int tabWidth, int indentWidth) { + return IndentManipulation.trimIndent(line, indentsToRemove, tabWidth, indentWidth); + } + + /** + * Removes the common number of indents from all lines. If a line + * only consists out of white space it is ignored. + * @param lines the lines + + * @param project the java project from which to get the formatter + * preferences, or <code>null</code> for global preferences + * @since 3.1 + */ + public static void trimIndentation(String[] lines, IJavaProject project) { + trimIndentation(lines, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), true); + } + /** + * Removes the common number of indents from all lines. If a line + * only consists out of white space it is ignored. + * @param lines the lines + * @param tabWidth the size of one tab in space equivalents + * @param indentWidth the size of the indent in space equivalents + * + * @since 3.1 + */ + public static void trimIndentation(String[] lines, int tabWidth, int indentWidth) { + trimIndentation(lines, tabWidth, indentWidth, true); + } + + /** + * Removes the common number of indents from all lines. If a line + * only consists out of white space it is ignored. If <code> + * considerFirstLine</code> is false the first line will be ignored. + * @param lines the lines + * + * @param project the java project from which to get the formatter + * preferences, or <code>null</code> for global preferences + * @param considerFirstLine If <code>considerFirstLine</code> is false the first line will be ignored. + * @since 3.1 + */ + public static void trimIndentation(String[] lines, IJavaProject project, boolean considerFirstLine) { + trimIndentation(lines, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), considerFirstLine); + } + + /** + * Removes the common number of indents from all lines. If a line + * only consists out of white space it is ignored. If <code> + * considerFirstLine</code> is false the first line will be ignored. + * @param lines the lines + * @param tabWidth the size of one tab in space equivalents + * @param indentWidth the size of the indent in space equivalents + * @param considerFirstLine If <code> considerFirstLine</code> is false the first line will be ignored. + * @since 3.1 + */ + public static void trimIndentation(String[] lines, int tabWidth, int indentWidth, boolean considerFirstLine) { + String[] toDo= new String[lines.length]; + // find indentation common to all lines + int minIndent= Integer.MAX_VALUE; // very large + for (int i= considerFirstLine ? 0 : 1; i < lines.length; i++) { + String line= lines[i]; + if (containsOnlyWhitespaces(line)) + continue; + toDo[i]= line; + int indent= computeIndentUnits(line, tabWidth, indentWidth); + if (indent < minIndent) { + minIndent= indent; + } + } + + if (minIndent > 0) { + // remove this indent from all lines + for (int i= considerFirstLine ? 0 : 1; i < toDo.length; i++) { + String s= toDo[i]; + if (s != null) + lines[i]= trimIndent(s, minIndent, tabWidth, indentWidth); + else { + String line= lines[i]; + int indent= computeIndentUnits(line, tabWidth, indentWidth); + if (indent > minIndent) + lines[i]= trimIndent(line, minIndent, tabWidth, indentWidth); + else + lines[i]= trimLeadingTabsAndSpaces(line); + } + } + } + } + + /** + * Returns that part of the indentation of <code>line</code> that makes up + * a multiple of indentation units. + * + * @param line the line to scan + * @param project the java project from which to get the formatter + * preferences, or <code>null</code> for global preferences + * @return the indent part of <code>line</code>, but no odd spaces + * @since 3.1 + */ + public static String getIndentString(String line, IJavaProject project) { + return IndentManipulation.extractIndentString(line, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); + } + + /** + * Returns that part of the indentation of <code>line</code> that makes up + * a multiple of indentation units. + * + * @param line the line to scan + * @param tabWidth the size of one tab in space equivalents + * @param indentWidth the size of the indent in space equivalents + * @return the indent part of <code>line</code>, but no odd spaces + * @since 3.1 + */ + public static String getIndentString(String line, int tabWidth, int indentWidth) { + return IndentManipulation.extractIndentString(line, tabWidth, indentWidth); + } + + public static String[] removeTrailingEmptyLines(String[] sourceLines) { + int lastNonEmpty= findLastNonEmptyLineIndex(sourceLines); + String[] result= new String[lastNonEmpty + 1]; + for (int i= 0; i < result.length; i++) { + result[i]= sourceLines[i]; + } + return result; + } + + private static int findLastNonEmptyLineIndex(String[] sourceLines) { + for (int i= sourceLines.length - 1; i >= 0; i--) { + if (! sourceLines[i].trim().equals(""))//$NON-NLS-1$ + return i; + } + return -1; + } + + /** + * Change the indent of, possible multi-line, code range. The current indent is removed, a new indent added. + * The first line of the code will not be changed. (It is considered to have no indent as it might start in + * the middle of a line) + * @param code the code + * @param codeIndentLevel level of indentation + * + * @param project the java project from which to get the formatter + * preferences, or <code>null</code> for global preferences + * @param newIndent new indent + * @param lineDelim line delimiter + * @return the changed code + * @since 3.1 + */ + public static String changeIndent(String code, int codeIndentLevel, IJavaProject project, String newIndent, String lineDelim) { + return IndentManipulation.changeIndent(code, codeIndentLevel, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), newIndent, lineDelim); + } + + /** + * Change the indent of, possible muti-line, code range. The current indent is removed, a new indent added. + * The first line of the code will not be changed. (It is considered to have no indent as it might start in + * the middle of a line) + * @param code the code + * @param codeIndentLevel indent level + * @param tabWidth the size of one tab in space equivalents + * @param indentWidth the size of the indent in space equivalents + * @param newIndent new indent + * @param lineDelim line delimiter + * @return the changed code + * @since 3.1 + */ + public static String changeIndent(String code, int codeIndentLevel, int tabWidth, int indentWidth, String newIndent, String lineDelim) { + return IndentManipulation.changeIndent(code, codeIndentLevel, tabWidth, indentWidth, newIndent, lineDelim); + } + + public static String trimIndentation(String source, IJavaProject project, boolean considerFirstLine) { + return trimIndentation(source, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), considerFirstLine); + } + + public static String trimIndentation(String source, int tabWidth, int indentWidth, boolean considerFirstLine) { + try { + ILineTracker tracker= new DefaultLineTracker(); + tracker.set(source); + int size= tracker.getNumberOfLines(); + if (size == 1) + return source; + String lines[]= new String[size]; + for (int i= 0; i < size; i++) { + IRegion region= tracker.getLineInformation(i); + int offset= region.getOffset(); + lines[i]= source.substring(offset, offset + region.getLength()); + } + Strings.trimIndentation(lines, tabWidth, indentWidth, considerFirstLine); + StringBuffer result= new StringBuffer(); + int last= size - 1; + for (int i= 0; i < size; i++) { + result.append(lines[i]); + if (i < last) + result.append(tracker.getLineDelimiter(i)); + } + return result.toString(); + } catch (BadLocationException e) { + Assert.isTrue(false,"Can not happend"); //$NON-NLS-1$ + return null; + } + } + + + /** + * Concatenate the given strings into one strings using the passed line delimiter as a + * delimiter. No delimiter is added to the last line. + * @param lines the lines + * @param delimiter line delimiter + * @return the concatenated lines + */ + public static String concatenate(String[] lines, String delimiter) { + StringBuffer buffer= new StringBuffer(); + for (int i= 0; i < lines.length; i++) { + if (i > 0) + buffer.append(delimiter); + buffer.append(lines[i]); + } + return buffer.toString(); + } + + public static boolean equals(String s, char[] c) { + if (s.length() != c.length) + return false; + + for (int i = c.length; --i >= 0;) + if (s.charAt(i) != c[i]) + return false; + return true; + } + + public static String removeTrailingCharacters(String text, char toRemove) { + int size= text.length(); + int end= size; + for (int i= size - 1; i >= 0; i--) { + char c= text.charAt(i); + if (c == toRemove) { + end= i; + } else { + break; + } + } + if (end == size) + return text; + else if (end == 0) + return ""; //$NON-NLS-1$ + else + return text.substring(0, end); + } +} diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java index 17e6913918..61a5bd3c17 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ASTFlattener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,9 +17,6 @@ import org.eclipse.core.runtime.Assert; import org.eclipse.jdt.core.dom.*; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; - - public class ASTFlattener extends GenericVisitor { /** @@ -63,7 +60,7 @@ public class ASTFlattener extends GenericVisitor { } public static String asString(ASTNode node) { - Assert.isTrue(node.getAST().apiLevel() == ASTProvider.SHARED_AST_LEVEL); + Assert.isTrue(node.getAST().apiLevel() == IASTSharedValues.SHARED_AST_LEVEL); ASTFlattener flattener= new ASTFlattener(); node.accept(flattener); diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java index a23eeb8eb5..c010d02de5 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java @@ -108,16 +108,12 @@ import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jdt.core.dom.VariableDeclarationStatement; import org.eclipse.jdt.core.dom.WhileStatement; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; +import org.eclipse.jdt.core.formatter.IndentManipulation; -import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; +import org.eclipse.jdt.internal.core.manipulation.JavaManipulationPlugin; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil; -import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; -import org.eclipse.jdt.internal.corext.util.Strings; - -import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.preferences.MembersOrderPreferenceCache; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; /** * JDT-UI-internal helper methods that deal with {@link ASTNode}s: @@ -126,9 +122,8 @@ import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; * <li>finding related nodes in an AST</li> * <li>some methods that deal with bindings (new such methods should go into {@link Bindings})</li> * </ul> - * - * @see JDTUIHelperClasses */ +// @see JDTUIHelperClasses public class ASTNodes { public static final int NODE_ONLY= 0; @@ -164,7 +159,8 @@ public class ASTNodes { try { edit.apply(document, TextEdit.NONE); } catch (BadLocationException e) { - JavaPlugin.log(e); + // bug in the formatter + JavaManipulationPlugin.log(e); } return document.get(); } @@ -192,7 +188,7 @@ public class ASTNodes { String str= buffer.getText(offset, length); if (removeIndent) { IJavaProject project= typeRoot.getJavaProject(); - int indent= StubUtility.getIndentUsed(buffer, node.getStartPosition(), project); + int indent= getIndentUsed(buffer, node.getStartPosition(), project); str= Strings.changeIndent(str, indent, project, new String(), typeRoot.findRecommendedLineSeparator()); } return str; @@ -204,6 +200,15 @@ public class ASTNodes { return null; } + private static int getIndentUsed(IBuffer buffer, int offset, IJavaProject project) { + int i= offset; + // find beginning of line + while (i > 0 && !IndentManipulation.isLineDelimiterChar(buffer.getChar(i - 1))) { + i--; + } + return Strings.computeIndentUnits(buffer.getText(i, offset - i), project); + } + /** * Returns the list that contains the given ASTNode. If the node * isn't part of any list, <code>null</code> is returned. @@ -1268,84 +1273,6 @@ public class ASTNodes { } } - - private static int getOrderPreference(BodyDeclaration member, MembersOrderPreferenceCache store) { - int memberType= member.getNodeType(); - int modifiers= member.getModifiers(); - - switch (memberType) { - case ASTNode.TYPE_DECLARATION: - case ASTNode.ENUM_DECLARATION : - case ASTNode.ANNOTATION_TYPE_DECLARATION : - return store.getCategoryIndex(MembersOrderPreferenceCache.TYPE_INDEX) * 2; - case ASTNode.FIELD_DECLARATION: - if (Modifier.isStatic(modifiers)) { - int index= store.getCategoryIndex(MembersOrderPreferenceCache.STATIC_FIELDS_INDEX) * 2; - if (Modifier.isFinal(modifiers)) { - return index; // first final static, then static - } - return index + 1; - } - return store.getCategoryIndex(MembersOrderPreferenceCache.FIELDS_INDEX) * 2; - case ASTNode.INITIALIZER: - if (Modifier.isStatic(modifiers)) { - return store.getCategoryIndex(MembersOrderPreferenceCache.STATIC_INIT_INDEX) * 2; - } - return store.getCategoryIndex(MembersOrderPreferenceCache.INIT_INDEX) * 2; - case ASTNode.ANNOTATION_TYPE_MEMBER_DECLARATION: - return store.getCategoryIndex(MembersOrderPreferenceCache.METHOD_INDEX) * 2; - case ASTNode.METHOD_DECLARATION: - if (Modifier.isStatic(modifiers)) { - return store.getCategoryIndex(MembersOrderPreferenceCache.STATIC_METHODS_INDEX) * 2; - } - if (((MethodDeclaration) member).isConstructor()) { - return store.getCategoryIndex(MembersOrderPreferenceCache.CONSTRUCTORS_INDEX) * 2; - } - return store.getCategoryIndex(MembersOrderPreferenceCache.METHOD_INDEX) * 2; - default: - return 100; - } - } - - /** - * Computes the insertion index to be used to add the given member to the - * the list <code>container</code>. - * @param member the member to add - * @param container a list containing objects of type <code>BodyDeclaration</code> - * @return the insertion index to be used - */ - public static int getInsertionIndex(BodyDeclaration member, List<? extends BodyDeclaration> container) { - int containerSize= container.size(); - - MembersOrderPreferenceCache orderStore= JavaPlugin.getDefault().getMemberOrderPreferenceCache(); - - int orderIndex= getOrderPreference(member, orderStore); - - int insertPos= containerSize; - int insertPosOrderIndex= -1; - - for (int i= containerSize - 1; i >= 0; i--) { - int currOrderIndex= getOrderPreference(container.get(i), orderStore); - if (orderIndex == currOrderIndex) { - if (insertPosOrderIndex != orderIndex) { // no perfect match yet - insertPos= i + 1; // after a same kind - insertPosOrderIndex= orderIndex; // perfect match - } - } else if (insertPosOrderIndex != orderIndex) { // not yet a perfect match - if (currOrderIndex < orderIndex) { // we are bigger - if (insertPosOrderIndex == -1) { - insertPos= i + 1; // after - insertPosOrderIndex= currOrderIndex; - } - } else { - insertPos= i; // before - insertPosOrderIndex= currOrderIndex; - } - } - } - return insertPos; - } - public static SimpleName getLeftMostSimpleName(Name name) { if (name instanceof SimpleName) { return (SimpleName)name; @@ -1492,7 +1419,7 @@ public class ASTNodes { * @see StringLiteral#getEscapedValue() */ public static String getEscapedStringLiteral(String stringValue) { - StringLiteral stringLiteral= AST.newAST(ASTProvider.SHARED_AST_LEVEL).newStringLiteral(); + StringLiteral stringLiteral= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL).newStringLiteral(); stringLiteral.setLiteralValue(stringValue); return stringLiteral.getEscapedValue(); } @@ -1505,7 +1432,7 @@ public class ASTNodes { * @see CharacterLiteral#getEscapedValue() */ public static String getEscapedCharacterLiteral(char ch) { - CharacterLiteral characterLiteral= AST.newAST(ASTProvider.SHARED_AST_LEVEL).newCharacterLiteral(); + CharacterLiteral characterLiteral= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL).newCharacterLiteral(); characterLiteral.setCharValue(ch); return characterLiteral.getEscapedValue(); } diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java index 5a449c1929..c88758cc9f 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/Bindings.java @@ -61,8 +61,6 @@ import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor; import org.eclipse.jdt.core.dom.SuperFieldAccess; import org.eclipse.jdt.core.dom.SuperMethodInvocation; -import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; -import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; /** @@ -72,9 +70,8 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; * <li>finding corresponding elements in the type hierarchy</li> * <li>resolve bindings from a family of {@link ASTNode} types</li> * </ul> - * - * @see JDTUIHelperClasses */ +// @see JDTUIHelperClasses public class Bindings { public static final String ARRAY_LENGTH_FIELD_BINDING_STRING= "(array type):length";//$NON-NLS-1$ @@ -141,9 +138,10 @@ public class Bindings { /** * Note: this method is for debugging and testing purposes only. * There are tests whose pre-computed test results rely on the returned String's format. + * Use org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider to present a binding to the user. + * * @param binding the binding * @return a string representation of given binding - * @see org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider */ public static String asString(IBinding binding) { if (binding instanceof IMethodBinding) @@ -798,7 +796,7 @@ public class Bindings { } } - static boolean containsTypeVariables(ITypeBinding type) { + public static boolean containsTypeVariables(ITypeBinding type) { if (type.isTypeVariable()) return true; if (type.isArray()) @@ -1509,7 +1507,6 @@ public class Bindings { * @return the expression binding, or <code>null</code> if the expression has no binding or the * binding could not be resolved * - * @see StubUtility#getVariableNameSuggestions(int, IJavaProject, ITypeBinding, Expression, java.util.Collection) * @since 3.5 */ public static IBinding resolveExpressionBinding(Expression expression, boolean goIntoCast) { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/GenericVisitor.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/GenericVisitor.java index dd3d032d4e..0020462edf 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/GenericVisitor.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/GenericVisitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -105,16 +105,13 @@ import org.eclipse.jdt.core.dom.VariableDeclarationStatement; import org.eclipse.jdt.core.dom.WhileStatement; import org.eclipse.jdt.core.dom.WildcardType; -import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; - /** * ASTVisitor that forwards all <code>visit(*)</code> calls to {@link #visitNode(ASTNode)}. * <p> * Note: New code should better use {@link ASTVisitor#preVisit2(ASTNode)}. * </p> - * - * @see JDTUIHelperClasses */ +// @see JDTUIHelperClasses public class GenericVisitor extends ASTVisitor { public GenericVisitor() { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/HierarchicalASTVisitor.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/HierarchicalASTVisitor.java index d332bab084..ce6b7f5e98 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/HierarchicalASTVisitor.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/HierarchicalASTVisitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,8 +12,6 @@ package org.eclipse.jdt.internal.corext.dom; import org.eclipse.jdt.core.dom.*; -import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; - /** * <p> * This class provides a convenient behaviour-only extension mechanism for the ASTNode hierarchy. If @@ -25,11 +23,11 @@ import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; * in visit(Foo). This class will provide appropriate dispatch, just as if the method * implementations had been added to the ASTNode hierarchy. * </p> - * + * * <p> * <b>Details:<b> * </p> - * + * * <p> * This class has a visit(XX node) method for every class (concrete or abstract) XX in the ASTNode * hierarchy. In this class' default implementations of these methods, the method corresponding to a @@ -37,7 +35,7 @@ import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; * for it's superclass YY, with the exception of the visit(ASTNode) method which simply returns * true, since ASTNode doesn't have a superclass that is within the ASTNode hierarchy. * </p> - * + * * <p> * Because of this organization, when visit(XX) methods are overridden in a subclass, and the * visitor is applied to a node, only the most specialized overridden method implementation for the @@ -46,16 +44,16 @@ import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; * must be XX) which will invoke this class' implementation of the method, which will, in turn, * invoke the visit(YY) method corresponding to the superclass, YY. * </p> - * + * * <p> * Thus, the dispatching behaviour achieved when HierarchicalASTVisitors' visit(XX) methods, * corresponding to a particular concrete or abstract ASTNode descendant class, are overridden is * exactly analogous to the dispatching behaviour obtained when method implementations are added to * the same ASTNode descendant classes. * </p> - * - * @see JDTUIHelperClasses + * */ +// @see JDTUIHelperClasses /* * IMPORTANT NOTE: * @@ -74,7 +72,7 @@ public abstract class HierarchicalASTVisitor extends ASTVisitor { * <p> * The default implementation does nothing and return true. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be visited, and * <code>false</code> if the children of this node should be skipped @@ -88,7 +86,7 @@ public abstract class HierarchicalASTVisitor extends ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ASTNode node) { @@ -272,12 +270,12 @@ public abstract class HierarchicalASTVisitor extends ASTVisitor { public boolean visit(Dimension node) { return visit((ASTNode)node); } - + @Override public void endVisit(Dimension node) { endVisit((ASTNode)node); } - + //---- Begin Expression Hierarchy ---------------------------------- public boolean visit(Expression node) { return visit((ASTNode)node); @@ -452,12 +450,12 @@ public abstract class HierarchicalASTVisitor extends ASTVisitor { public boolean visit(LambdaExpression node) { return visit((Expression)node); } - + @Override public void endVisit(LambdaExpression node) { endVisit((Expression)node); } - + @Override public boolean visit(MethodInvocation node) { return visit((Expression)node); @@ -472,7 +470,7 @@ public abstract class HierarchicalASTVisitor extends ASTVisitor { public boolean visit(MethodReference node) { return visit((Expression)node); } - + public void endVisit(MethodReference node) { endVisit((Expression)node); } @@ -491,32 +489,32 @@ public abstract class HierarchicalASTVisitor extends ASTVisitor { public boolean visit(ExpressionMethodReference node) { return visit((MethodReference)node); } - + @Override public void endVisit(ExpressionMethodReference node) { endVisit((MethodReference)node); } - + @Override public boolean visit(SuperMethodReference node) { return visit((MethodReference)node); } - + @Override public void endVisit(SuperMethodReference node) { endVisit((MethodReference)node); } - + @Override public boolean visit(TypeMethodReference node) { return visit((MethodReference)node); } - + @Override public void endVisit(TypeMethodReference node) { endVisit((MethodReference)node); } - + //---- End MethodReference Hierarchy ------------------------------------ //---- Begin Name Hierarchy ---------------------------------- @@ -998,7 +996,7 @@ public abstract class HierarchicalASTVisitor extends ASTVisitor { public boolean visit(AnnotatableType node) { return visit((Type)node); } - + public void endVisit(AnnotatableType node) { endVisit((Type)node); } @@ -1068,7 +1066,7 @@ public abstract class HierarchicalASTVisitor extends ASTVisitor { public boolean visit(IntersectionType node) { return visit((Type)node); } - + @Override public void endVisit(IntersectionType node) { endVisit((Type)node); diff --git a/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/IASTSharedValues.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/IASTSharedValues.java new file mode 100644 index 0000000000..8bdbe31008 --- /dev/null +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/IASTSharedValues.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2016 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.internal.corext.dom; + +import org.eclipse.jdt.core.dom.AST; + +public interface IASTSharedValues { + + /** + * This value is subject to change with every release. JDT-UI-internal code typically supports + * the latest available {@link AST#apiLevel() AST level} exclusively. + */ + public static final int SHARED_AST_LEVEL= AST.JLS8; + + public static final boolean SHARED_AST_STATEMENT_RECOVERY= true; + + public static final boolean SHARED_BINDING_RECOVERY= true; +} diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ScopeAnalyzer.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ScopeAnalyzer.java index 3210f9f69a..258b7d1d64 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ScopeAnalyzer.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/ScopeAnalyzer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -50,7 +50,7 @@ import org.eclipse.jdt.core.dom.VariableDeclaration; import org.eclipse.jdt.core.dom.VariableDeclarationExpression; import org.eclipse.jdt.core.dom.VariableDeclarationStatement; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; /** * Evaluates all fields, methods and types available (declared) at a given offset diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/TokenScanner.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/TokenScanner.java index 317e1f91d1..349b318ade 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/TokenScanner.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/TokenScanner.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,6 +12,7 @@ package org.eclipse.jdt.internal.corext.dom; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; @@ -25,8 +26,9 @@ import org.eclipse.jdt.core.ToolFactory; import org.eclipse.jdt.core.compiler.IScanner; import org.eclipse.jdt.core.compiler.ITerminalSymbols; import org.eclipse.jdt.core.compiler.InvalidInputException; +import org.eclipse.jdt.core.manipulation.JavaManipulation; -import org.eclipse.jdt.internal.ui.JavaUIStatus; +import org.eclipse.jdt.internal.corext.dom.TokenScanner; /** * Wraps a scanner and offers convenient methods for finding tokens @@ -448,7 +450,6 @@ public class TokenScanner { } private IStatus createError(int code, String message, Throwable e) { - return JavaUIStatus.createError(code, message, e); + return new Status(IStatus.ERROR, JavaManipulation.ID_PLUGIN, code, message, e); } - } diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/TypeBindingVisitor.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/TypeBindingVisitor.java index 49729c058e..daf01722f3 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/TypeBindingVisitor.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/TypeBindingVisitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/TypeRules.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/TypeRules.java index 95a177c9a5..6434a6be68 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/TypeRules.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/dom/TypeRules.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,14 +19,12 @@ import org.eclipse.jdt.core.dom.PrimitiveType; import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType; import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TypeEnvironment; -import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; /** * Helper class to check if objects are assignable to each other. * Methods with multiple arguments also work across bindings environments. - * - * @see JDTUIHelperClasses */ +// @see JDTUIHelperClasses public class TypeRules { /** diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/TextChangeCompatibility.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/changes/TextChangeCompatibility.java index 331c4034e4..1f68d51046 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/TextChangeCompatibility.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/changes/TextChangeCompatibility.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/AbstractTypeVariable.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/AbstractTypeVariable.java index 0382e04c66..07d9da4583 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/AbstractTypeVariable.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/AbstractTypeVariable.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ArrayType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ArrayType.java index 9d9eb6f60d..c2238482ae 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ArrayType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ArrayType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/CaptureType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/CaptureType.java index 1076af57ed..21cc78d21d 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/CaptureType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/CaptureType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ExtendsWildcardType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ExtendsWildcardType.java index 29e3fb22a2..51b0fbb370 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ExtendsWildcardType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ExtendsWildcardType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/GenericType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/GenericType.java index 7e57c9d636..45d86a8c12 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/GenericType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/GenericType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/HierarchyType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/HierarchyType.java index 0d18ac7da6..dd61954263 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/HierarchyType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/HierarchyType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/NullType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/NullType.java index cba7884c5e..ee36a4067d 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/NullType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/NullType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types; - public final class NullType extends TType { protected NullType(TypeEnvironment environment) { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ParameterizedType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ParameterizedType.java index df83b0dfce..829bbf31ac 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ParameterizedType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/ParameterizedType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/PrimitiveType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/PrimitiveType.java index 9166fd171d..9f38438e8c 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/PrimitiveType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/PrimitiveType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/RawType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/RawType.java index 4799f95f8e..d2dba71c15 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/RawType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/RawType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/StandardType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/StandardType.java index 98b7b8f931..db4aae0bd6 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/StandardType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/StandardType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/SuperWildcardType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/SuperWildcardType.java index 791f198d87..2e4105aaa4 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/SuperWildcardType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/SuperWildcardType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TType.java index 21d02cf6a2..db0c491d8e 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeEnvironment.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeEnvironment.java index e03151b526..c8c09f2639 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeEnvironment.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeEnvironment.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -31,9 +31,7 @@ import org.eclipse.jdt.core.dom.ASTRequestor; import org.eclipse.jdt.core.dom.IBinding; import org.eclipse.jdt.core.dom.ITypeBinding; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; - - +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * A type environment comprises a set of {@link TType}s that stand for Java {@link ITypeBinding}s. @@ -145,7 +143,7 @@ public class TypeEnvironment { mapping.put(bindingKey, type); keys.add(bindingKey); } - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(project); parser.setResolveBindings(true); parser.createASTs(new ICompilationUnit[0], keys.toArray(new String[keys.size()]), @@ -277,7 +275,7 @@ public class TypeEnvironment { StandardType result= fStandardTypes.get(javaElementType); if (result != null) return result; - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(focus); IBinding[] bindings= parser.createBindings(new IJavaElement[] {javaElementType} , null); return createStandardType((ITypeBinding)bindings[0]); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeTuple.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeTuple.java index ee618a8bd9..0d7ca7f811 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeTuple.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeTuple.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types; - public class TypeTuple { private TType fFirst; private TType fSecond; diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeVariable.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeVariable.java index 0b37e4f3d9..33d1607ef7 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeVariable.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeVariable.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/UnboundWildcardType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/UnboundWildcardType.java index 2056234126..1272f28ed8 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/UnboundWildcardType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/UnboundWildcardType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/VoidType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/VoidType.java index b6099deefe..28f67b13b8 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/VoidType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/VoidType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/WildcardType.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/WildcardType.java index 27ca7e6854..616c650bf6 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/WildcardType.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/WildcardType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/TextEditUtil.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/util/TextEditUtil.java index a195cc5d41..23709c6bdf 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/TextEditUtil.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/refactoring/util/TextEditUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/SignatureUtil.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/template/java/SignatureUtil.java index 816141f0c1..89d94b9d75 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/SignatureUtil.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/template/java/SignatureUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -12,6 +12,7 @@ package org.eclipse.jdt.internal.corext.template.java; import java.util.Arrays; +import org.eclipse.jdt.core.CompletionProposal; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.Signature; @@ -317,4 +318,13 @@ public final class SignatureUtil { } return pos + 1; } + + public static String getQualifiedTypeName(CompletionProposal proposal) { + return String.valueOf(Signature.toCharArray(Signature + .getTypeErasure(proposal.getSignature()))); + } + + public static String getSimpleTypeName(CompletionProposal proposal) { + return Signature.getSimpleName(getQualifiedTypeName(proposal)); + } } diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/CodeFormatterUtil.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/CodeFormatterUtil.java index f73a580f9d..210a68ef70 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/CodeFormatterUtil.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/CodeFormatterUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,7 +30,7 @@ import org.eclipse.jdt.core.dom.Statement; import org.eclipse.jdt.core.formatter.CodeFormatter; import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; -import org.eclipse.jdt.internal.ui.JavaPlugin; +import org.eclipse.jdt.internal.core.manipulation.JavaManipulationPlugin; public class CodeFormatterUtil { @@ -187,7 +187,7 @@ public class CodeFormatterUtil { try { edit.apply(document, TextEdit.NONE); } catch (BadLocationException e) { - JavaPlugin.log(e); // bug in the formatter + JavaManipulationPlugin.log(e); // bug in the formatter Assert.isTrue(false, "Formatter created edits with wrong positions: " + e.getMessage()); //$NON-NLS-1$ } return document.get(); diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JavaModelUtil.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/JavaModelUtil.java index dccce34fbb..70b384296e 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JavaModelUtil.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/JavaModelUtil.java @@ -19,16 +19,11 @@ import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.SubMonitor; -import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IStorage; -import org.eclipse.text.edits.TextEdit; - import org.eclipse.jdt.core.ClasspathContainerInitializer; import org.eclipse.jdt.core.Flags; import org.eclipse.jdt.core.IClasspathContainer; @@ -49,9 +44,6 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.core.compiler.CharOperation; -import org.eclipse.jdt.internal.corext.CorextMessages; -import org.eclipse.jdt.internal.corext.ValidateEditException; - import org.eclipse.jdt.launching.IVMInstall; import org.eclipse.jdt.launching.IVMInstall2; import org.eclipse.jdt.launching.JavaRuntime; @@ -59,9 +51,8 @@ import org.eclipse.jdt.launching.environments.IExecutionEnvironment; /** * Utility methods for the Java Model. - * - * @see JDTUIHelperClasses */ +// @see JDTUIHelperClasses public final class JavaModelUtil { /** @@ -896,30 +887,6 @@ public final class JavaModelUtil { } } - /** - * Applies an text edit to a compilation unit. Filed bug 117694 against jdt.core. - * @param cu the compilation unit to apply the edit to - * @param edit the edit to apply - * @param save is set, save the CU after the edit has been applied - * @param monitor the progress monitor to use - * @throws CoreException Thrown when the access to the CU failed - * @throws ValidateEditException if validate edit fails - */ - public static void applyEdit(ICompilationUnit cu, TextEdit edit, boolean save, IProgressMonitor monitor) throws CoreException, ValidateEditException { - SubMonitor subMonitor= SubMonitor.convert(monitor, CorextMessages.JavaModelUtil_applyedit_operation, 2); - IFile file= (IFile) cu.getResource(); - if (!save || !file.exists()) { - cu.applyTextEdit(edit, subMonitor.split(2)); - } else { - IStatus status= Resources.makeCommittable(file, null); - if (!status.isOK()) { - throw new ValidateEditException(status); - } - cu.applyTextEdit(edit, subMonitor.split(1)); - cu.save(subMonitor.split(1), true); - } - } - public static boolean isImplicitImport(String qualifier, ICompilationUnit cu) { if ("java.lang".equals(qualifier)) { //$NON-NLS-1$ return true; @@ -955,5 +922,4 @@ public final class JavaModelUtil { public static boolean isPolymorphicSignature(IMethod method) { return method.getAnnotation("java.lang.invoke.MethodHandle$PolymorphicSignature").exists(); //$NON-NLS-1$ } - } diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JdtFlags.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/JdtFlags.java index 3d538cace0..6dcce41116 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JdtFlags.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/JdtFlags.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -33,7 +33,6 @@ import org.eclipse.jdt.core.dom.IVariableBinding; import org.eclipse.jdt.core.dom.Modifier; import org.eclipse.jdt.core.dom.TypeDeclaration; - /** * Java element flags from a Java language model point of view. * <p> @@ -44,9 +43,8 @@ import org.eclipse.jdt.core.dom.TypeDeclaration; * <p> * <code>JdtFlags</code> is the right choice for most analysis tasks and for presentation in the UI. * </p> - * - * @see JDTUIHelperClasses */ +// @see JDTUIHelperClasses public class JdtFlags { private JdtFlags(){ } diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/LRUMap.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/LRUMap.java index ca664e2bb5..0922841939 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/LRUMap.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/LRUMap.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/MethodOverrideTester.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/MethodOverrideTester.java index 2a578c7045..5fde1a805c 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/MethodOverrideTester.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/MethodOverrideTester.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -29,9 +29,8 @@ import org.eclipse.jdt.core.Signature; /** * Finds overriding and overridden methods based on the Java model. - * - * @see JDTUIHelperClasses */ +// @see JDTUIHelperClasses public class MethodOverrideTester { private static class Substitutions { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/SuperTypeHierarchyCache.java b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/SuperTypeHierarchyCache.java index 0386d32cf0..c4dca85542 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/SuperTypeHierarchyCache.java +++ b/org.eclipse.jdt.core.manipulation/core extension/org/eclipse/jdt/internal/corext/util/SuperTypeHierarchyCache.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -23,9 +23,8 @@ import org.eclipse.jdt.core.JavaModelException; /** * A thread-safe cache for super type hierarchies. - * - * @see JDTUIHelperClasses */ +// @see JDTUIHelperClasses public class SuperTypeHierarchyCache { private static class HierarchyCacheEntry implements ITypeHierarchyChangedListener { diff --git a/org.eclipse.jdt.core.manipulation/pom.xml b/org.eclipse.jdt.core.manipulation/pom.xml index 9db7d84e79..959acadf22 100644 --- a/org.eclipse.jdt.core.manipulation/pom.xml +++ b/org.eclipse.jdt.core.manipulation/pom.xml @@ -18,6 +18,6 @@ </parent> <groupId>org.eclipse.jdt</groupId> <artifactId>org.eclipse.jdt.core.manipulation</artifactId> - <version>1.8.0-SNAPSHOT</version> + <version>1.9.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/org.eclipse.jdt.junit/META-INF/MANIFEST.MF b/org.eclipse.jdt.junit/META-INF/MANIFEST.MF index 57b6e8fad2..da5d41626f 100644 --- a/org.eclipse.jdt.junit/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.junit/META-INF/MANIFEST.MF @@ -37,5 +37,6 @@ Require-Bundle: org.eclipse.core.variables;bundle-version="[3.2.200,4.0.0)", org.eclipse.ltk.ui.refactoring;bundle-version="[3.5.0,4.0.0)", org.eclipse.jdt.junit.core;bundle-version="[3.6.0,4.0.0)";visibility:=reexport, - com.ibm.icu;bundle-version="4.4.2" + com.ibm.icu;bundle-version="4.4.2", + org.eclipse.jdt.core.manipulation;bundle-version="1.9.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/JUnitStubUtility.java b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/JUnitStubUtility.java index 1235512f1a..28d2e51eb2 100644 --- a/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/JUnitStubUtility.java +++ b/org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/util/JUnitStubUtility.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,7 +43,7 @@ import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.ui.wizards.NewTypeWizardPage.ImportsManager; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * Utility methods for code generation. @@ -297,7 +297,7 @@ public class JUnitStubUtility { public static String[] getParameterTypeNamesForSeeTag(IMethod overridden) { try { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(overridden.getJavaProject()); IBinding[] bindings= parser.createBindings(new IJavaElement[] { overridden }, null); if (bindings.length == 1 && bindings[0] instanceof IMethodBinding) { diff --git a/org.eclipse.jdt.text.tests/META-INF/MANIFEST.MF b/org.eclipse.jdt.text.tests/META-INF/MANIFEST.MF index 2eb0ce85dc..e950ee949f 100644 --- a/org.eclipse.jdt.text.tests/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.text.tests/META-INF/MANIFEST.MF @@ -33,6 +33,7 @@ Require-Bundle: org.eclipse.core.filebuffers.tests, org.eclipse.jdt.ui.tests, org.eclipse.test.performance, - com.ibm.icu + com.ibm.icu, + org.eclipse.jdt.core.manipulation Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Eclipse-BundleShape: dir diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/BreakContinueTargetFinderTest.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/BreakContinueTargetFinderTest.java index 7e9abfef1f..196d6f96a8 100644 --- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/BreakContinueTargetFinderTest.java +++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/BreakContinueTargetFinderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 IBM Corporation and others. + * Copyright (c) 2005, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,9 +25,9 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.search.BreakContinueTargetFinder; -import org.eclipse.jdt.internal.ui.search.IOccurrencesFinder.OccurrenceLocation; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder.OccurrenceLocation; import junit.framework.Test; import junit.framework.TestCase; @@ -59,7 +59,7 @@ public class BreakContinueTargetFinderTest extends TestCase{ */ @Override protected void setUp() throws Exception { - fParser = ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + fParser = ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); fFinder= new BreakContinueTargetFinder(); fJProject1= ProjectTestSetup.getProject(); diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/MarkOccurrenceTest17.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/MarkOccurrenceTest17.java index a432bc0469..6cd08658a1 100644 --- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/MarkOccurrenceTest17.java +++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/MarkOccurrenceTest17.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 IBM Corporation and others. + * Copyright (c) 2011, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,10 +27,10 @@ import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.ui.tests.core.Java17ProjectTestSetup; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.search.ExceptionOccurrencesFinder; -import org.eclipse.jdt.internal.ui.search.IOccurrencesFinder; -import org.eclipse.jdt.internal.ui.search.IOccurrencesFinder.OccurrenceLocation; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder.OccurrenceLocation; import org.eclipse.jdt.internal.ui.search.MethodExitsFinder; import junit.framework.Test; @@ -64,7 +64,7 @@ public class MarkOccurrenceTest17 extends TestCase { */ @Override protected void setUp() throws Exception { - fParser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + fParser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); fJProject1= Java17ProjectTestSetup.getProject(); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); diff --git a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/MarkOccurrenceTest18.java b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/MarkOccurrenceTest18.java index d124ee6f7e..8042a6470c 100644 --- a/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/MarkOccurrenceTest18.java +++ b/org.eclipse.jdt.text.tests/src/org/eclipse/jdt/text/tests/MarkOccurrenceTest18.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 IBM Corporation and others. + * Copyright (c) 2011, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,10 +27,10 @@ import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.ui.tests.core.Java18ProjectTestSetup; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.search.ExceptionOccurrencesFinder; -import org.eclipse.jdt.internal.ui.search.IOccurrencesFinder; -import org.eclipse.jdt.internal.ui.search.IOccurrencesFinder.OccurrenceLocation; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder.OccurrenceLocation; import junit.framework.Test; import junit.framework.TestCase; @@ -60,7 +60,7 @@ public class MarkOccurrenceTest18 extends TestCase { */ @Override protected void setUp() throws Exception { - fParser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + fParser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); fJProject1= Java18ProjectTestSetup.getProject(); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); diff --git a/org.eclipse.jdt.ui.examples.javafamily/META-INF/MANIFEST.MF b/org.eclipse.jdt.ui.examples.javafamily/META-INF/MANIFEST.MF index bca16d9e37..42bc71413c 100644 --- a/org.eclipse.jdt.ui.examples.javafamily/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.ui.examples.javafamily/META-INF/MANIFEST.MF @@ -24,7 +24,8 @@ Require-Bundle: org.eclipse.core.resources, org.eclipse.jdt.launching, org.eclipse.jdt.debug.ui, org.eclipse.core.runtime, - org.eclipse.ltk.core.refactoring + org.eclipse.ltk.core.refactoring, + org.eclipse.jdt.core.manipulation;bundle-version="1.8.0" Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.4 Export-Package: org.eclipse.core.indexsearch;x-internal:=true, diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/BinaryReferencesTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/BinaryReferencesTests.java index 3bc450a2c9..4009f36424 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/BinaryReferencesTests.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/BinaryReferencesTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -57,7 +57,7 @@ import org.eclipse.jdt.internal.corext.refactoring.structure.MoveInstanceMethodP import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; import junit.framework.Test; @@ -375,7 +375,7 @@ public class BinaryReferencesTests extends TestCase { private static List<SearchMatch> doInlineMethod(String typeName, String methodName) throws JavaModelException, Exception, CoreException { IMethod method= findMethod(findType(typeName), methodName); ICompilationUnit cu= method.getCompilationUnit(); - CompilationUnit node= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(cu, true); + CompilationUnit node= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(cu, true); ISourceRange nameRange= method.getNameRange(); Refactoring refactoring= InlineMethodRefactoring.create(cu, node, nameRange.getOffset(), nameRange.getLength()); return doCheckConditions(refactoring); @@ -393,7 +393,7 @@ public class BinaryReferencesTests extends TestCase { IMethod baseMethod= findMethod(findType("source.BaseClass"), "baseMethod"); ICompilationUnit cu= baseMethod.getCompilationUnit(); - CompilationUnit node= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(cu, true); + CompilationUnit node= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(cu, true); MethodDeclaration baseDecl= ASTNodeSearchUtil.getMethodDeclarationNode(baseMethod, node); ExpressionStatement methodStmt= (ExpressionStatement) baseDecl.getBody().statements().get(0); diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/DelegateCreatorTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/DelegateCreatorTests.java index fc73e9cf50..cc5d132b73 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/DelegateCreatorTests.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/DelegateCreatorTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -37,7 +37,7 @@ import org.eclipse.jdt.internal.corext.refactoring.structure.ASTNodeSearchUtil; import org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite; import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class DelegateCreatorTests extends RefactoringTest { @@ -77,7 +77,7 @@ public class DelegateCreatorTests extends RefactoringTest { if (newTypeName != null) { ICompilationUnit cu2= createCUfromTestFile(getPackageP(), newTypeName); IType classNew= getType(cu2, newTypeName); - CompilationUnit cuNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(cu2, true, null); + CompilationUnit cuNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(cu2, true, null); TypeDeclaration td= ASTNodeSearchUtil.getTypeDeclarationNode(classNew, cuNode); destination= td.resolveBinding(); } @@ -155,7 +155,7 @@ public class DelegateCreatorTests extends RefactoringTest { IPackageFragment e= getRoot().createPackageFragment("e", true, null); ICompilationUnit cu2= createCUfromTestFile(e, "E"); IType classNew= getType(cu2, "E"); - CompilationUnit cuNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(cu2, true, null); + CompilationUnit cuNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(cu2, true, null); TypeDeclaration td= ASTNodeSearchUtil.getTypeDeclarationNode(classNew, cuNode); ITypeBinding destination= td.resolveBinding(); @@ -219,7 +219,7 @@ public class DelegateCreatorTests extends RefactoringTest { IPackageFragment e= getRoot().createPackageFragment("e", true, null); ICompilationUnit cu2= createCUfromTestFile(e, "E"); IType classNew= getType(cu2, "E"); - CompilationUnit cuNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(cu2, true, null); + CompilationUnit cuNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(cu2, true, null); TypeDeclaration td= ASTNodeSearchUtil.getTypeDeclarationNode(classNew, cuNode); ITypeBinding destination= td.resolveBinding(); diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineConstantTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineConstantTests.java index 04e5aedab7..5fdefe99c7 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineConstantTests.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineConstantTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -29,7 +29,7 @@ import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; import org.eclipse.jdt.ui.tests.refactoring.infra.TextRangeUtil; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class InlineConstantTests extends RefactoringTest { private static final Class<InlineConstantTests> clazz = InlineConstantTests.class; @@ -101,7 +101,7 @@ public class InlineConstantTests extends RefactoringTest { ICompilationUnit selectionCu= cus[selectionCuIndex]; ISourceRange selection= TextRangeUtil.getSelection(selectionCu, startLine, startColumn, endLine, endColumn); - InlineConstantRefactoring ref= new InlineConstantRefactoring(selectionCu, new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(selectionCu, true), selection.getOffset(), selection.getLength()); + InlineConstantRefactoring ref= new InlineConstantRefactoring(selectionCu, new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(selectionCu, true), selection.getOffset(), selection.getLength()); if (ref.checkStaticFinalConstantNameSelected().hasFatalError()) ref= null; RefactoringStatus preconditionResult= ref.checkInitialConditions(new NullProgressMonitor()); @@ -140,7 +140,7 @@ public class InlineConstantTests extends RefactoringTest { ICompilationUnit selectionCu= cus[selectionCuIndex]; ISourceRange selection= TextRangeUtil.getSelection(selectionCu, startLine, startColumn, endLine, endColumn); - InlineConstantRefactoring ref= new InlineConstantRefactoring(selectionCu, new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(selectionCu, true), selection.getOffset(), selection.getLength()); + InlineConstantRefactoring ref= new InlineConstantRefactoring(selectionCu, new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(selectionCu, true), selection.getOffset(), selection.getLength()); if (ref.checkStaticFinalConstantNameSelected().hasFatalError()) ref= null; if (ref == null) diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java index 0228334e76..7d820f50fa 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -42,7 +42,7 @@ import org.eclipse.jdt.internal.corext.refactoring.code.InlineMethodRefactoring; import org.eclipse.jdt.internal.corext.refactoring.code.OperatorPrecedence; import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class InlineMethodTests extends AbstractSelectionTestCase { private static InlineMethodTestSetup fgTestSetup; @@ -81,7 +81,7 @@ public class InlineMethodTests extends AbstractSelectionTestCase { protected void performTestInlineCall(IPackageFragment packageFragment, String id, int mode, String outputFolder) throws Exception { ICompilationUnit unit= createCU(packageFragment, id); int[] selection= getSelection(); - InlineMethodRefactoring refactoring= InlineMethodRefactoring.create(unit, new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(unit, true), selection[0], selection[1]); + InlineMethodRefactoring refactoring= InlineMethodRefactoring.create(unit, new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(unit, true), selection[0], selection[1]); String out= null; if (mode == COMPARE_WITH_OUTPUT) @@ -94,7 +94,7 @@ public class InlineMethodTests extends AbstractSelectionTestCase { ICompilationUnit unit= createCU(packageFragment, id); IType type= unit.getTypes()[0]; IMethod method= getMethodToInline(type); - InlineMethodRefactoring refactoring= InlineMethodRefactoring.create(unit, new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(unit, true), method.getNameRange().getOffset(), method.getNameRange().getLength()); + InlineMethodRefactoring refactoring= InlineMethodRefactoring.create(unit, new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(unit, true), method.getNameRange().getOffset(), method.getNameRange().getLength()); String out= null; if (mode == COMPARE_WITH_OUTPUT) @@ -116,7 +116,7 @@ public class InlineMethodTests extends AbstractSelectionTestCase { ICompilationUnit unit= createCU(packageFragment, id); IType type= unit.getTypes()[0]; IMethod method= getFirstConstructor(type); - InlineMethodRefactoring refactoring= InlineMethodRefactoring.create(unit, new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(unit, true), method.getNameRange().getOffset(), method.getNameRange().getLength()); + InlineMethodRefactoring refactoring= InlineMethodRefactoring.create(unit, new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(unit, true), method.getNameRange().getOffset(), method.getNameRange().getLength()); String out= null; if (mode == COMPARE_WITH_OUTPUT) @@ -203,7 +203,7 @@ public class InlineMethodTests extends AbstractSelectionTestCase { public void testNotMethodName() throws Exception { ICompilationUnit unit= createCU(fgTestSetup.getInvalidPackage(), getName()); int[] selection= getSelection(); - InlineMethodRefactoring refactoring= InlineMethodRefactoring.create(unit, new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(unit, true), selection[0], selection[1]); + InlineMethodRefactoring refactoring= InlineMethodRefactoring.create(unit, new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(unit, true), selection[0], selection[1]); assertNull(refactoring); } @@ -984,7 +984,7 @@ public class InlineMethodTests extends AbstractSelectionTestCase { IMethod logMessage= target2type.getMethods()[1]; // method 0 is ctor InlineMethodRefactoring refactoring= InlineMethodRefactoring.create( target2ClassFile, - new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(target2ClassFile, true), + new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(target2ClassFile, true), logMessage.getNameRange().getOffset(), logMessage.getNameRange().getLength()); @@ -1065,7 +1065,7 @@ public class InlineMethodTests extends AbstractSelectionTestCase { } public void testOperatorPredence() throws Exception { - AST ast= AST.newAST(ASTProvider.SHARED_AST_LEVEL); + AST ast= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL); int assignment= OperatorPrecedence.getExpressionPrecedence(ast.newAssignment()); int conditional= OperatorPrecedence.getExpressionPrecedence(ast.newConditionalExpression()); diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RefactoringTest.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RefactoringTest.java index 816503b1b2..fec87154b7 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RefactoringTest.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/RefactoringTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -63,7 +63,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.refactoring.descriptors.JavaRefactoringDescriptor; import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.tests.refactoring.infra.RefactoringTestPlugin; diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ReplaceInvocationsTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ReplaceInvocationsTests.java index 1198c985bb..539b2fe426 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ReplaceInvocationsTests.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ReplaceInvocationsTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2014 IBM Corporation and others. + * Copyright (c) 2006, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,7 +24,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.internal.corext.refactoring.code.ReplaceInvocationsRefactoring; import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class ReplaceInvocationsTests extends AbstractSelectionTestCase { private static RewriteMethodInvocationsTestSetup fgTestSetup; @@ -63,7 +63,7 @@ public class ReplaceInvocationsTests extends AbstractSelectionTestCase { ICompilationUnit unit= createCU(packageFragment, id); int[] selection= getSelection(); - CompilationUnit compilationUnit= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(unit, false); + CompilationUnit compilationUnit= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(unit, false); Comment comment= (Comment) compilationUnit.getCommentList().get(0); String commentString= unit.getBuffer().getText(comment.getStartPosition(), comment.getLength()); Matcher matcher= Pattern.compile("(?s)/\\*\\s*params:[^\\r\\n&&\\s]*" + "([^\\r\\n]*)" + "(\\r\\n?|\\n)" + "(.+)" + "\\*/").matcher(commentString); diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/CopyToClipboardActionTest.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/CopyToClipboardActionTest.java index 57b61c442e..d72e229aed 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/CopyToClipboardActionTest.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/CopyToClipboardActionTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -38,7 +38,7 @@ import org.eclipse.jdt.core.IType; import org.eclipse.jdt.internal.corext.refactoring.TypedSource; import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaElementTransfer; import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgUtils; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaElementLabelProvider; import org.eclipse.jdt.ui.tests.refactoring.RefactoringTest; diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NlsRefactoringCheckFinalConditionsTest.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NlsRefactoringCheckFinalConditionsTest.java index a67b6654b3..e1c3689ff5 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NlsRefactoringCheckFinalConditionsTest.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NlsRefactoringCheckFinalConditionsTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -36,7 +36,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class NlsRefactoringCheckFinalConditionsTest extends TestCase { diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/typeconstraints/TypeEnvironmentTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/typeconstraints/TypeEnvironmentTests.java index 3d330fb063..6ae8852d0c 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/typeconstraints/TypeEnvironmentTests.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/typeconstraints/TypeEnvironmentTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,7 +39,7 @@ import org.eclipse.jdt.ui.tests.refactoring.RefactoringTestSetup; import org.eclipse.jdt.ui.tests.refactoring.infra.AbstractCUTestCase; import org.eclipse.jdt.ui.tests.refactoring.infra.RefactoringTestPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import junit.framework.Test; import junit.framework.TestSuite; @@ -191,7 +191,7 @@ public class TypeEnvironmentTests extends AbstractCUTestCase { private ASTNode createAST(IPackageFragment pack) throws Exception { IJavaProject project= pack.getJavaProject(); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(project); parser.setResolveBindings(true); ICompilationUnit unit= createCU(pack, getName()); diff --git a/org.eclipse.jdt.ui.tests/examples/org/eclipse/jdt/ui/examples/ASTRewriteSnippet.java b/org.eclipse.jdt.ui.tests/examples/org/eclipse/jdt/ui/examples/ASTRewriteSnippet.java index af02bdcaee..1b3b0324a9 100644 --- a/org.eclipse.jdt.ui.tests/examples/org/eclipse/jdt/ui/examples/ASTRewriteSnippet.java +++ b/org.eclipse.jdt.ui.tests/examples/org/eclipse/jdt/ui/examples/ASTRewriteSnippet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,7 +43,7 @@ import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; import org.eclipse.jdt.launching.JavaRuntime; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class ASTRewriteSnippet extends TestCase { @@ -86,7 +86,7 @@ public class ASTRewriteSnippet extends TestCase { ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); // create an AST - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(false); CompilationUnit astRoot= (CompilationUnit) parser.createAST(null); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ASTNodesInsertTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ASTNodesInsertTest.java index 5c0f03f168..787b67e43a 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ASTNodesInsertTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ASTNodesInsertTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -32,9 +32,9 @@ import org.eclipse.jdt.core.dom.PrimitiveType; import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.jdt.core.dom.VariableDeclarationFragment; -import org.eclipse.jdt.internal.corext.dom.ASTNodes; +import org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import junit.framework.Test; import junit.framework.TestSuite; @@ -94,31 +94,31 @@ public class ASTNodesInsertTest extends CoreTests { AST ast = astRoot.getAST(); BodyDeclaration declaration= createNewField(ast, Modifier.PRIVATE); - int insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + int insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(1, insertionIndex); // after the first field declaration= createNewField(ast, Modifier.STATIC); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(0, insertionIndex); // before the normal field declaration= createNewField(ast, Modifier.STATIC | Modifier.FINAL); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(0, insertionIndex); // before the normal field declaration= createNewMethod(ast, Modifier.PRIVATE, false); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(2, insertionIndex); // after the normal method declaration= createNewMethod(ast, Modifier.STATIC, false); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(0, insertionIndex); // before the normal field declaration= createNewMethod(ast, 0, true); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(1, insertionIndex); // before the normal method declaration= createNewType(ast, 0); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(0, insertionIndex); // before all } @@ -144,31 +144,31 @@ public class ASTNodesInsertTest extends CoreTests { AST ast = astRoot.getAST(); BodyDeclaration declaration= createNewField(ast, Modifier.PRIVATE); - int insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + int insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(2, insertionIndex); // after the const declaration= createNewField(ast, Modifier.STATIC); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(2, insertionIndex); // after the const declaration= createNewField(ast, Modifier.STATIC | Modifier.FINAL); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(2, insertionIndex); // after the const declaration= createNewMethod(ast, Modifier.PRIVATE, false); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(3, insertionIndex); // after the constructor declaration= createNewMethod(ast, Modifier.STATIC, false); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(2, insertionIndex); // before the constructor declaration= createNewMethod(ast, 0, true); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(3, insertionIndex); // after the constructor declaration= createNewType(ast, 0); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(1, insertionIndex); // after the inner } @@ -196,31 +196,31 @@ public class ASTNodesInsertTest extends CoreTests { AST ast = astRoot.getAST(); BodyDeclaration declaration= createNewField(ast, Modifier.PRIVATE); - int insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + int insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(2, insertionIndex); // before the method declaration= createNewField(ast, Modifier.STATIC); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(2, insertionIndex); // after the static declaration= createNewField(ast, Modifier.STATIC | Modifier.FINAL); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(1, insertionIndex); // after the const declaration= createNewMethod(ast, Modifier.PRIVATE, false); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(4, insertionIndex); // after the method declaration= createNewMethod(ast, Modifier.STATIC, false); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(2, insertionIndex); // before the constructor declaration= createNewMethod(ast, 0, true); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(3, insertionIndex); // after the constructor declaration= createNewType(ast, 0); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(5, insertionIndex); // after the inner } @@ -248,31 +248,31 @@ public class ASTNodesInsertTest extends CoreTests { AST ast = astRoot.getAST(); BodyDeclaration declaration= createNewField(ast, Modifier.PRIVATE); - int insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + int insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(3, insertionIndex); // after fInt2 declaration= createNewField(ast, Modifier.STATIC); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(0, insertionIndex); // before normal field declaration= createNewField(ast, Modifier.STATIC | Modifier.FINAL); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(5, insertionIndex); // after the const declaration= createNewMethod(ast, Modifier.PRIVATE, false); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(6, insertionIndex); // after the method declaration= createNewMethod(ast, Modifier.STATIC, false); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(0, insertionIndex); // before the normal field declaration= createNewMethod(ast, 0, true); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(5, insertionIndex); // after the constructor declaration= createNewType(ast, 0); - insertionIndex= ASTNodes.getInsertionIndex(declaration, bodyDecls); + insertionIndex= BodyDeclarationRewrite.getInsertionIndex(declaration, bodyDecls); assertEquals(0, insertionIndex); // after the inner } @@ -302,7 +302,7 @@ public class ASTNodesInsertTest extends CoreTests { } private CompilationUnit createAST(ICompilationUnit compilationUnit) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(compilationUnit); parser.setResolveBindings(true); return (CompilationUnit) parser.createAST(null); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java index 19f06e7551..33ed44ba17 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -45,9 +45,9 @@ import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; import org.eclipse.jdt.internal.corext.codemanipulation.AddImportsOperation; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.corext.dom.ASTNodes; -import org.eclipse.jdt.internal.corext.util.JavaModelUtil; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.text.correction.AssistContext; public class AddImportTest extends CoreTests { @@ -296,7 +296,7 @@ public class AddImportTest extends CoreTests { buf.append("}\n"); ICompilationUnit cuT= test1.createCompilationUnit("T.java", buf.toString(), false, null); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cuT); parser.setResolveBindings(true); CompilationUnit astRoot= (CompilationUnit) parser.createAST(null); @@ -523,7 +523,7 @@ public class AddImportTest extends CoreTests { String[] order= new String[] { "java.util", "java.io", "java.net" }; int threshold= 99; - AST ast= AST.newAST(ASTProvider.SHARED_AST_LEVEL); + AST ast= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL); ImportRewrite importsRewrite= newImportsRewrite(cu2, order, threshold, true); { IJavaElement[] elements= cu1.codeSelect(content.indexOf("IOException"), "IOException".length()); @@ -582,7 +582,7 @@ public class AddImportTest extends CoreTests { buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(true); CompilationUnit astRoot= (CompilationUnit) parser.createAST(null); @@ -620,7 +620,7 @@ public class AddImportTest extends CoreTests { buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(true); CompilationUnit astRoot= (CompilationUnit) parser.createAST(null); @@ -658,7 +658,7 @@ public class AddImportTest extends CoreTests { buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(true); CompilationUnit astRoot= (CompilationUnit) parser.createAST(null); @@ -709,7 +709,7 @@ public class AddImportTest extends CoreTests { String[] order= new String[] { "java.util", "java.io", "java.net" }; int threshold= 99; - AST ast= AST.newAST(ASTProvider.SHARED_AST_LEVEL); + AST ast= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL); ImportRewrite importsRewrite= newImportsRewrite(cu2, order, threshold, true); { IJavaElement[] elements= cu1.codeSelect(content.indexOf("Map"), "Map".length()); @@ -1852,7 +1852,7 @@ public class AddImportTest extends CoreTests { private void apply(ImportRewrite rewrite) throws CoreException { TextEdit edit= rewrite.rewriteImports(null); - JavaModelUtil.applyEdit(rewrite.getCompilationUnit(), edit, true, null); + JavaElementUtil.applyEdit(rewrite.getCompilationUnit(), edit, true, null); } } diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/BindingsNameTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/BindingsNameTest.java index 01902ec572..9378dcd91e 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/BindingsNameTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/BindingsNameTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -28,7 +28,7 @@ import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.jdt.internal.corext.dom.Bindings; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import junit.framework.Test; import junit.framework.TestCase; @@ -206,7 +206,7 @@ public class BindingsNameTest extends TestCase { } private CompilationUnit createAST(ICompilationUnit compilationUnit) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(compilationUnit); parser.setResolveBindings(true); return (CompilationUnit) parser.createAST(null); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterUtilTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterUtilTest.java index 1ee832752e..b387e68433 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterUtilTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterUtilTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -42,7 +42,7 @@ import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class CodeFormatterUtilTest extends CoreTests { @@ -281,7 +281,7 @@ public class CodeFormatterUtilTest extends CoreTests { buf.append(" package com . test1;"); String contents= buf.toString(); - AST ast= AST.newAST(ASTProvider.SHARED_AST_LEVEL); + AST ast= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL); PackageDeclaration decl= ast.newPackageDeclaration(); TextEdit edit= CodeFormatterUtil.format2(decl, contents, 0, "\n", null); @@ -299,7 +299,7 @@ public class CodeFormatterUtilTest extends CoreTests { buf.append("package com . test1;"); String contents= buf.toString(); - AST ast= AST.newAST(ASTProvider.SHARED_AST_LEVEL); + AST ast= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL); PackageDeclaration node= ast.newPackageDeclaration(); String word1= "com"; @@ -333,7 +333,7 @@ public class CodeFormatterUtilTest extends CoreTests { buf.append("x[ ]=\nnew int[ offset]"); String contents= buf.toString(); - AST ast= AST.newAST(ASTProvider.SHARED_AST_LEVEL); + AST ast= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL); VariableDeclarationFragment node= ast.newVariableDeclarationFragment(); String word1= "new"; @@ -369,7 +369,7 @@ public class CodeFormatterUtilTest extends CoreTests { buf.append(" */\n"); String contents= buf.toString(); - AST ast= AST.newAST(ASTProvider.SHARED_AST_LEVEL); + AST ast= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL); Javadoc node= ast.newJavadoc(); String word1= "bar"; @@ -407,7 +407,7 @@ public class CodeFormatterUtilTest extends CoreTests { buf.append(" */"); String contents= buf.toString(); - AST ast= AST.newAST(ASTProvider.SHARED_AST_LEVEL); + AST ast= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL); Javadoc node= ast.newJavadoc(); String word1= "bar"; @@ -445,7 +445,7 @@ public class CodeFormatterUtilTest extends CoreTests { buf.append(" */"); String contents= buf.toString(); - AST ast= AST.newAST(ASTProvider.SHARED_AST_LEVEL); + AST ast= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL); Javadoc node= ast.newJavadoc(); String word1= "bar"; @@ -484,7 +484,7 @@ public class CodeFormatterUtilTest extends CoreTests { buf.append("}"); String contents= buf.toString(); - AST ast= AST.newAST(ASTProvider.SHARED_AST_LEVEL); + AST ast= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL); CatchClause node= ast.newCatchClause(); String word1= "catch"; @@ -519,7 +519,7 @@ public class CodeFormatterUtilTest extends CoreTests { buf.append("\"Hello\" "); String contents= buf.toString(); - AST ast= AST.newAST(ASTProvider.SHARED_AST_LEVEL); + AST ast= AST.newAST(IASTSharedValues.SHARED_AST_LEVEL); StringLiteral node= ast.newStringLiteral(); TextEdit edit= CodeFormatterUtil.format2(node, contents, 0, "\n", null); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/JDTFlagsTest18.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/JDTFlagsTest18.java index 4962b65909..475603009c 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/JDTFlagsTest18.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/JDTFlagsTest18.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2015 IBM Corporation and others. + * Copyright (c) 2013, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -47,7 +47,7 @@ import org.eclipse.jdt.core.dom.MethodDeclaration; import org.eclipse.jdt.internal.corext.refactoring.structure.ASTNodeSearchUtil; import org.eclipse.jdt.internal.corext.util.JdtFlags; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import junit.framework.Test; import junit.framework.TestCase; @@ -110,7 +110,7 @@ public class JDTFlagsTest18 extends TestCase { Assert.assertFalse(JdtFlags.isAbstract(method)); Assert.assertFalse(JdtFlags.isDefaultMethod(method)); - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setProject(fJProject1); p.setBindingsRecovery(true); try { @@ -281,7 +281,7 @@ public class JDTFlagsTest18 extends TestCase { Assert.assertFalse(JdtFlags.isAbstract(method)); Assert.assertTrue(JdtFlags.isDefaultMethod(method)); - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setProject(pack1.getJavaProject()); p.setBindingsRecovery(true); try { @@ -329,7 +329,7 @@ public class JDTFlagsTest18 extends TestCase { Assert.assertFalse(JdtFlags.isAbstract(method)); Assert.assertFalse(JdtFlags.isDefaultMethod(method)); - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setProject(pack1.getJavaProject()); p.setBindingsRecovery(true); try { @@ -346,7 +346,7 @@ public class JDTFlagsTest18 extends TestCase { Assert.assertTrue(JdtFlags.isAbstract(method)); Assert.assertFalse(JdtFlags.isDefaultMethod(method)); - p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setProject(pack1.getJavaProject()); p.setBindingsRecovery(true); try { @@ -376,7 +376,7 @@ public class JDTFlagsTest18 extends TestCase { MethodDeclaration methodNode= ASTNodeSearchUtil.getMethodDeclarationNode(method, getCompilationUnitNode(buf.toString())); Assert.assertFalse(JdtFlags.isStatic(methodNode)); - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setProject(pack1.getJavaProject()); p.setBindingsRecovery(true); try { @@ -403,7 +403,7 @@ public class JDTFlagsTest18 extends TestCase { Assert.assertFalse(JdtFlags.isDefaultMethod(method)); Assert.assertTrue(JdtFlags.isAbstract(method)); - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setProject(pack1.getJavaProject()); p.setBindingsRecovery(true); try { diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/MethodOverrideTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/MethodOverrideTest.java index 82b272845e..b581d057e5 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/MethodOverrideTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/MethodOverrideTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -49,7 +49,7 @@ import org.eclipse.jdt.internal.corext.util.MethodOverrideTester; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; import junit.framework.Test; @@ -439,7 +439,7 @@ public class MethodOverrideTest extends CoreTests { } protected CompilationUnit assertNoCompilationError(ICompilationUnit cu) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(true); CompilationUnit root= (CompilationUnit) parser.createAST(null); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/OverrideTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/OverrideTest.java index 47899886a1..d258368c98 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/OverrideTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/OverrideTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -31,7 +31,7 @@ import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.jdt.internal.corext.dom.Bindings; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class OverrideTest extends TestCase { @@ -68,7 +68,7 @@ public class OverrideTest extends TestCase { } private static CompilationUnit createAST(ICompilationUnit compilationUnit) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(compilationUnit); parser.setResolveBindings(true); return (CompilationUnit) parser.createAST(null); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/PartialASTTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/PartialASTTest.java index 3f538ea04b..d99c888f86 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/PartialASTTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/PartialASTTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -44,7 +44,7 @@ import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import junit.framework.Test; import junit.framework.TestSuite; @@ -512,7 +512,7 @@ public class PartialASTTest extends CoreTests { } private CompilationUnit getPartialCompilationUnit(ICompilationUnit cu, int offset) { - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setSource(cu); p.setFocalPosition(offset); p.setResolveBindings(true); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ScopeAnalyzerTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ScopeAnalyzerTest.java index fcbb2cf8b7..1cca60b042 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ScopeAnalyzerTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ScopeAnalyzerTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,7 +30,7 @@ import org.eclipse.jdt.core.dom.IBinding; import org.eclipse.jdt.internal.corext.dom.ScopeAnalyzer; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** */ @@ -930,7 +930,7 @@ public class ScopeAnalyzerTest extends CoreTests { } private CompilationUnit createAST(ICompilationUnit compilationUnit) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(compilationUnit); parser.setResolveBindings(true); return (CompilationUnit) parser.createAST(null); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/StringsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/StringsTest.java index 922ca1c1c1..456c93409d 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/StringsTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/StringsTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14,7 +14,7 @@ import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; public class StringsTest extends TestCase { diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TypeRulesTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TypeRulesTest.java index b5faf58547..c87a4c6029 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TypeRulesTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TypeRulesTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -32,7 +32,7 @@ import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jdt.internal.corext.dom.TypeRules; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import junit.framework.Test; import junit.framework.TestSuite; @@ -145,7 +145,7 @@ public class TypeRulesTest extends CoreTests { buf.append("}\n"); ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu1); parser.setResolveBindings(true); @@ -184,7 +184,7 @@ public class TypeRulesTest extends CoreTests { buf.append("}\n"); char[] content= buf.toString().toCharArray(); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(content); parser.setResolveBindings(true); parser.setProject(fJProject1); @@ -225,7 +225,7 @@ public class TypeRulesTest extends CoreTests { buf.append("}\n"); char[] content= buf.toString().toCharArray(); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(content); parser.setResolveBindings(true); parser.setProject(fJProject1); @@ -268,7 +268,7 @@ public class TypeRulesTest extends CoreTests { buf.append("}\n"); char[] content= buf.toString().toCharArray(); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(content); parser.setResolveBindings(true); parser.setProject(fJProject1); @@ -311,7 +311,7 @@ public class TypeRulesTest extends CoreTests { buf.append("}\n"); char[] content= buf.toString().toCharArray(); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(content); parser.setResolveBindings(true); parser.setProject(fJProject1); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedConstructorsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedConstructorsTest.java index 98cae7917f..964417f4e5 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedConstructorsTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedConstructorsTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -49,7 +49,7 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.ui.tests.core.CoreTests; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; public class AddUnimplementedConstructorsTest extends CoreTests { @@ -108,7 +108,7 @@ public class AddUnimplementedConstructorsTest extends CoreTests { } private AddUnimplementedConstructorsOperation createOperation(IType type, int insertPos) throws CoreException { - RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); + RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); CompilationUnit unit= parser.parse(type.getCompilationUnit(), true); AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(unit, type.getNameRange()), AbstractTypeDeclaration.class); assertNotNull("Could not find type declararation node", declaration); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest.java index ff33d99d3d..b9b41dd0ba 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -54,13 +54,13 @@ import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; import org.eclipse.jdt.internal.corext.template.java.CodeTemplateContextType; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class AddUnimplementedMethodsTest extends TestCase { @@ -443,7 +443,7 @@ public class AddUnimplementedMethodsTest extends TestCase { } private void testHelper(IType testClass, int insertionPos, boolean implementAllOverridable) throws JavaModelException, CoreException { - RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); + RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); CompilationUnit unit= parser.parse(testClass.getCompilationUnit(), true); AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(unit, testClass.getNameRange()), AbstractTypeDeclaration.class); assertNotNull("Could not find type declaration node", declaration); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest18.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest18.java index b214eaa943..7fd7ee9d22 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest18.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest18.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 IBM Corporation and others. + * Copyright (c) 2015, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -37,7 +37,7 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.ui.tests.core.Java18ProjectTestSetup; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import junit.framework.Test; import junit.framework.TestCase; @@ -92,7 +92,7 @@ public class AddUnimplementedMethodsTest18 extends TestCase { } private void testHelper(IType testClass, int insertionPos, boolean implementAllOverridable) throws JavaModelException, CoreException { - RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); + RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); CompilationUnit unit= parser.parse(testClass.getCompilationUnit(), true); AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(unit, testClass.getNameRange()), AbstractTypeDeclaration.class); assertNotNull("Could not find type declaration node", declaration); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java index fa08ed2bd0..bfd9f1ffbc 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -45,7 +45,7 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * Tests generation of constructors using fields @@ -71,7 +71,7 @@ public class GenerateConstructorUsingFieldsTest extends SourceTestCase { public void runOperation(IType type, IField[] fields, IMethod superConstructor, IJavaElement insertBefore, boolean createComments, boolean omitSuper, int visibility) throws CoreException { - RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); + RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); CompilationUnit unit= parser.parse(type.getCompilationUnit(), true); ITypeBinding typeBinding= ASTNodes.getTypeBinding(unit, type); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java index fb642caaaf..7883b9838d 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,7 +43,7 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * Tests generation of delegate methods @@ -81,7 +81,7 @@ public class GenerateDelegateMethodsTest extends SourceTestCase { Assert.assertEquals(fields.length, methods.length); - RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); + RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); CompilationUnit unit= parser.parse(type.getCompilationUnit(), true); DelegateEntry[] entries= new DelegateEntry[fields.length]; diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateGettersSettersTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateGettersSettersTest.java index c6b8fc9200..0b0774f376 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateGettersSettersTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateGettersSettersTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -41,7 +41,7 @@ import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * Tests generation of getters and setters. @@ -98,7 +98,7 @@ public class GenerateGettersSettersTest extends SourceTestCase { } }; - RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); + RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); CompilationUnit unit= parser.parse(type.getCompilationUnit(), true); AddGetterSetterOperation op= new AddGetterSetterOperation(type, getters, setters, gettersAndSetters, unit, allYes, sibling, fSettings, true, true); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateHashCodeEqualsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateHashCodeEqualsTest.java index 768b179c66..d450dbecea 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateHashCodeEqualsTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateHashCodeEqualsTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -42,7 +42,7 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * Tests generation of delegate methods @@ -66,7 +66,7 @@ public class GenerateHashCodeEqualsTest extends SourceTestCase { public void runOperation(IType type, IField[] fields, IJavaElement insertBefore, boolean createComments, boolean useInstanceof, boolean useBlocks, boolean force) throws CoreException { - RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); + RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); CompilationUnit unit= parser.parse(type.getCompilationUnit(), true); IVariableBinding[] fKeys= new IVariableBinding[fields.length]; diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java index 5e3f404026..8c3fa74fb9 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateToStringTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Mateusz Matela and others. + * Copyright (c) 2008, 2016 Mateusz Matela and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -55,8 +55,7 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; - +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class GenerateToStringTest extends SourceTestCase { @@ -137,7 +136,7 @@ public class GenerateToStringTest extends SourceTestCase { public void runOperation(IType type, IMember[] members, IJavaElement insertBefore) throws CoreException { - RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); + RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); CompilationUnit unit= parser.parse(type.getCompilationUnit(), true); Object[] fKeys= new Object[members.length]; @@ -195,7 +194,7 @@ public class GenerateToStringTest extends SourceTestCase { } private static CompilationUnit getCUNode(ICompilationUnit cu) throws Exception { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setResolveBindings(true); parser.setSource(cu); return (CompilationUnit)parser.createAST(null); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AbstractAnnotateAssistTests.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AbstractAnnotateAssistTests.java index 376be07944..edc23a0be5 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AbstractAnnotateAssistTests.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AbstractAnnotateAssistTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 GK Software AG and others. + * Copyright (c) 2015, 2016 GK Software AG and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,7 +40,7 @@ import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.internal.core.ClasspathEntry; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; import org.eclipse.jdt.ui.tests.quickfix.JarUtil.ClassFileFilter; diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java index 55de9581ff..35d223532a 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpStressTest.java @@ -5507,7 +5507,7 @@ public class CleanUpStressTest extends CleanUpTestCase { // } // // private void assertNoCompileErrors(ICompilationUnit[] units) throws JavaModelException, CoreException { -// ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); +// ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); // parser.setResolveBindings(true); // parser.setProject(fJProject1); // diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java index 6a140302d0..3c1973cb06 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -48,7 +48,7 @@ import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.fix.Java50CleanUp; import org.eclipse.jdt.internal.ui.fix.UnimplementedCodeCleanUp; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.text.correction.ProblemLocation; import junit.framework.Test; @@ -1417,7 +1417,7 @@ public class CleanUpTest extends CleanUpTestCase { map.put(CleanUpConstants.VARIABLE_DECLARATION_USE_TYPE_ARGUMENTS_FOR_RAW_TYPE_REFERENCES, CleanUpOptions.TRUE); Java50CleanUp cleanUp= new Java50CleanUp(map); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setResolveBindings(true); parser.setProject(fJProject1); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/PropertiesFileQuickAssistTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/PropertiesFileQuickAssistTest.java index b74dcda86f..5d00f613d1 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/PropertiesFileQuickAssistTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/PropertiesFileQuickAssistTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2012 IBM Corporation and others. + * Copyright (c) 2011, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -46,7 +46,7 @@ import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest.java index 927b3e9e68..3a769fde83 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest.java @@ -45,6 +45,8 @@ import org.eclipse.jdt.core.dom.MethodDeclaration; import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.jdt.core.dom.VariableDeclarationFragment; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; + import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; import org.eclipse.jdt.ui.text.java.IInvocationContext; import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal; @@ -52,7 +54,6 @@ import org.eclipse.jdt.ui.text.java.IProblemLocation; import org.eclipse.jdt.ui.text.java.correction.CUCorrectionProposal; import org.eclipse.jdt.ui.text.java.correction.ICommandAccess; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.AssistContext; import org.eclipse.jdt.internal.ui.text.correction.GetterSetterCorrectionSubProcessor.SelfEncapsulateFieldProposal; import org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionProcessor; diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UtilitiesTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UtilitiesTest.java index 086c0c1b01..b8a3178e7e 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UtilitiesTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UtilitiesTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -32,11 +32,12 @@ import org.eclipse.jdt.core.dom.NodeFinder; import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; + import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.ui.tests.core.ProjectTestSetup; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.SimilarElementsRequestor; import junit.framework.Test; @@ -213,7 +214,7 @@ public class UtilitiesTest extends QuickFixTest { FieldDeclaration[] fields= ((TypeDeclaration) astRoot.types().get(0)).getFields(); for (int i= 0; i < fields.length; i++) { ASTNode node= NodeFinder.perform(astRoot, buf.indexOf("X", fields[i].getStartPosition()), 1); - int kinds= ASTResolving.getPossibleTypeKinds(node, true); + int kinds= org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getPossibleTypeKinds(node, true); if (kinds != expected[i]) { assertEquals("Guessing failed for " + fields[i].toString(), expected[i], kinds); } diff --git a/org.eclipse.jdt.ui/META-INF/MANIFEST.MF b/org.eclipse.jdt.ui/META-INF/MANIFEST.MF index a52505d2e3..d4f02d7a04 100644 --- a/org.eclipse.jdt.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.jdt.ui/META-INF/MANIFEST.MF @@ -36,7 +36,6 @@ Export-Package: org.eclipse.jdt.internal.corext;x-friends:="org.eclipse.jdt.juni org.eclipse.jdt.internal.corext.refactoring.surround;x-internal:=true, org.eclipse.jdt.internal.corext.refactoring.tagging;x-internal:=true, org.eclipse.jdt.internal.corext.refactoring.typeconstraints;x-internal:=true, - org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types;x-internal:=true, org.eclipse.jdt.internal.corext.refactoring.typeconstraints.typesets;x-internal:=true, org.eclipse.jdt.internal.corext.refactoring.typeconstraints2;x-internal:=true, org.eclipse.jdt.internal.corext.refactoring.util;x-internal:=true, @@ -138,7 +137,7 @@ Require-Bundle: org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)", org.eclipse.ui.navigator;bundle-version="[3.3.200,4.0.0)", org.eclipse.ui.navigator.resources;bundle-version="[3.4.0,4.0.0)", - org.eclipse.jdt.core.manipulation;bundle-version="[1.7.0,2.0.0)", + org.eclipse.jdt.core.manipulation;bundle-version="[1.9.0,2.0.0)", com.ibm.icu;bundle-version="4.4.2", org.eclipse.equinox.bidi;bundle-version="[0.10.0,2.0.0)" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/buildpath/ClasspathModifier.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/buildpath/ClasspathModifier.java index 927787b4a4..8f10ae5d81 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/buildpath/ClasspathModifier.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/buildpath/ClasspathModifier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -55,7 +55,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.buildpaths.ArchiveFileFilter; import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport; diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/callhierarchy/CallHierarchy.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/callhierarchy/CallHierarchy.java index 2e4b01abaf..336e049e2c 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/callhierarchy/CallHierarchy.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/callhierarchy/CallHierarchy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -38,7 +38,7 @@ import org.eclipse.jdt.core.search.SearchEngine; import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.util.StringMatcher; public class CallHierarchy { @@ -284,7 +284,7 @@ public class CallHierarchy { ITypeRoot typeRoot= member.getTypeRoot(); try { if (typeRoot.exists() && typeRoot.getBuffer() != null) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(typeRoot); parser.setResolveBindings(resolveBindings); return (CompilationUnit) parser.createAST(null); diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java index 447c160153..47ca9e87fa 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddCustomConstructorOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -36,9 +36,10 @@ import org.eclipse.jdt.core.dom.MethodDeclaration; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; + import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; -import org.eclipse.jdt.internal.corext.util.JavaModelUtil; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; /** * Workspace runnable to add custom constructors initializing fields. @@ -187,7 +188,7 @@ public final class AddCustomConstructorOperation implements IWorkspaceRunnable { fResultingEdit.addChild(importRewrite.rewriteImports(new SubProgressMonitor(monitor, 1))); if (fApply) { - JavaModelUtil.applyEdit(cu, fResultingEdit, fSave, new SubProgressMonitor(monitor, 1)); + JavaElementUtil.applyEdit(cu, fResultingEdit, fSave, new SubProgressMonitor(monitor, 1)); } } } finally { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddDelegateMethodsOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddDelegateMethodsOperation.java index c5de8c0112..09284330a8 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddDelegateMethodsOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddDelegateMethodsOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,7 +43,7 @@ import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; import org.eclipse.jdt.internal.corext.util.DelegateEntryComparator; -import org.eclipse.jdt.internal.corext.util.JavaModelUtil; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; /** * Workspace runnable to add delegate methods. @@ -194,7 +194,7 @@ public final class AddDelegateMethodsOperation implements IWorkspaceRunnable { fResultingEdit.addChild(importRewrite.rewriteImports(new SubProgressMonitor(monitor, 1))); if (fApply) { - JavaModelUtil.applyEdit(cu, fResultingEdit, fSave, new SubProgressMonitor(monitor, 1)); + JavaElementUtil.applyEdit(cu, fResultingEdit, fSave, new SubProgressMonitor(monitor, 1)); } } } finally { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddGetterSetterOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddGetterSetterOperation.java index a7124596e0..8ee4fdd1f2 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddGetterSetterOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddGetterSetterOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -52,6 +52,7 @@ import org.eclipse.jdt.core.formatter.CodeFormatter; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.ModifierRewrite; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; @@ -351,7 +352,7 @@ public final class AddGetterSetterOperation implements IWorkspaceRunnable { } fEdit= astRewrite.rewriteAST(); if (fApply) { - JavaModelUtil.applyEdit(unit, fEdit, fSave, new SubProgressMonitor(monitor, 1)); + JavaElementUtil.applyEdit(unit, fEdit, fSave, new SubProgressMonitor(monitor, 1)); } } finally { monitor.done(); diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddImportsOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddImportsOperation.java index d13054312d..4fffb50e89 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddImportsOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddImportsOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -62,7 +62,9 @@ import org.eclipse.jdt.core.search.SearchEngine; import org.eclipse.jdt.core.search.SearchPattern; import org.eclipse.jdt.core.search.TypeNameMatch; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.corext.dom.ASTNodes; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.util.JavaConventionsUtil; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; @@ -73,7 +75,6 @@ import org.eclipse.jdt.ui.SharedASTProvider; import org.eclipse.jdt.internal.ui.JavaUIStatus; import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.SimilarElementsRequestor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; /** @@ -186,7 +187,7 @@ public class AddImportsOperation implements IWorkspaceRunnable { fResultingEdit= res; if (fApply) { - JavaModelUtil.applyEdit(fCompilationUnit, res, fDoSave, new SubProgressMonitor(monitor, 1)); + JavaElementUtil.applyEdit(fCompilationUnit, res, fDoSave, new SubProgressMonitor(monitor, 1)); } } finally { monitor.done(); diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddJavaDocStubOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddJavaDocStubOperation.java index 200071cf7e..1bb77d72fc 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddJavaDocStubOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddJavaDocStubOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -47,7 +47,7 @@ import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.internal.corext.dom.TokenScanner; import org.eclipse.jdt.internal.corext.util.MethodOverrideTester; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache; import org.eclipse.jdt.ui.CodeGeneration; diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddUnimplementedConstructorsOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddUnimplementedConstructorsOperation.java index f7a14f5355..1ea4b4f059 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddUnimplementedConstructorsOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddUnimplementedConstructorsOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -41,7 +41,7 @@ import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; -import org.eclipse.jdt.internal.corext.util.JavaModelUtil; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; @@ -251,7 +251,7 @@ public final class AddUnimplementedConstructorsOperation implements IWorkspaceRu edit.addChild(astRewrite.rewriteAST()); if (fApply) { - JavaModelUtil.applyEdit(cu, edit, fSave, new SubProgressMonitor(monitor, 1)); + JavaElementUtil.applyEdit(cu, edit, fSave, new SubProgressMonitor(monitor, 1)); } } finally { monitor.done(); diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddUnimplementedMethodsOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddUnimplementedMethodsOperation.java index c065d72081..cf005f8c2b 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddUnimplementedMethodsOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/AddUnimplementedMethodsOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,7 +43,7 @@ import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; -import org.eclipse.jdt.internal.corext.util.JavaModelUtil; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.util.MethodsSourcePositionComparator; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; @@ -231,7 +231,7 @@ public final class AddUnimplementedMethodsOperation implements IWorkspaceRunnabl edit.addChild(astRewrite.rewriteAST()); if (fApply) { - JavaModelUtil.applyEdit(cu, edit, fSave, new SubProgressMonitor(monitor, 1)); + JavaElementUtil.applyEdit(cu, edit, fSave, new SubProgressMonitor(monitor, 1)); } } finally { monitor.done(); diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/GenerateHashCodeEqualsOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/GenerateHashCodeEqualsOperation.java index 598e3d2294..de4075825a 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/GenerateHashCodeEqualsOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/GenerateHashCodeEqualsOperation.java @@ -76,6 +76,7 @@ import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.ui.CodeGeneration; @@ -338,7 +339,7 @@ public final class GenerateHashCodeEqualsOperation implements IWorkspaceRunnable fEdit= fRewrite.createChange(true).getEdit(); if (fApply) - JavaModelUtil.applyEdit(cu, fEdit, fSave, monitor); + JavaElementUtil.applyEdit(cu, fEdit, fSave, monitor); } } finally { monitor.done(); diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/OrganizeImportsOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/OrganizeImportsOperation.java index fec65431f1..2ea1f69b55 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/OrganizeImportsOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/OrganizeImportsOperation.java @@ -59,20 +59,21 @@ import org.eclipse.jdt.core.search.IJavaSearchScope; import org.eclipse.jdt.core.search.SearchEngine; import org.eclipse.jdt.core.search.TypeNameMatch; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.dom.ScopeAnalyzer; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; import org.eclipse.jdt.internal.corext.util.TypeNameMatchCollector; import org.eclipse.jdt.ui.SharedASTProvider; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.ProblemLocation; import org.eclipse.jdt.internal.ui.text.correction.SimilarElementsRequestor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; public class OrganizeImportsOperation implements IWorkspaceRunnable { public static interface IChooseImportQuery { @@ -192,7 +193,7 @@ public class OrganizeImportsOperation implements IWorkspaceRunnable { public UnresolvedTypeData(SimpleName ref) { this.ref= ref; - this.typeKinds= ASTResolving.getPossibleTypeKinds(ref, true); + this.typeKinds= org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getPossibleTypeKinds(ref, true); this.foundInfos= new ArrayList<>(3); } @@ -348,7 +349,7 @@ public class OrganizeImportsOperation implements IWorkspaceRunnable { TypeNameMatchCollector collector= new TypeNameMatchCollector(typesFound); new SearchEngine().searchAllTypeNames(null, allTypes, scope, collector, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, monitor); - boolean is50OrHigher= JavaModelUtil.is50OrHigher(project); + boolean is50OrHigher= JavaModelUtil.is50OrHigher(project); for (i= 0; i < typesFound.size(); i++) { TypeNameMatch curr= typesFound.get(i); @@ -526,7 +527,7 @@ public class OrganizeImportsOperation implements IWorkspaceRunnable { if (edit == null) return; - JavaModelUtil.applyEdit(fCompilationUnit, edit, fDoSave, new SubProgressMonitor(monitor, 1)); + JavaElementUtil.applyEdit(fCompilationUnit, edit, fDoSave, new SubProgressMonitor(monitor, 1)); } finally { monitor.done(); } diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/SortMembersOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/SortMembersOperation.java index 84302e45ea..5fb4bbb764 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/SortMembersOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/SortMembersOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -41,7 +41,7 @@ import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.preferences.MembersOrderPreferenceCache; /** @@ -323,7 +323,7 @@ public class SortMembersOperation implements IWorkspaceRunnable { */ @Override public void run(IProgressMonitor monitor) throws CoreException { - CompilationUnitSorter.sort(ASTProvider.SHARED_AST_LEVEL, fCompilationUnit, fPositions, new DefaultJavaElementComparator(fDoNotSortFields), 0, monitor); + CompilationUnitSorter.sort(IASTSharedValues.SHARED_AST_LEVEL, fCompilationUnit, fPositions, new DefaultJavaElementComparator(fDoNotSortFields), 0, monitor); } /** diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility.java index 77395269d2..97e3b5c37f 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -101,7 +101,8 @@ import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.template.java.CodeTemplateContext; import org.eclipse.jdt.internal.corext.template.java.CodeTemplateContextType; import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.CodeStyleConfiguration; @@ -109,8 +110,8 @@ import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIStatus; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; + import org.eclipse.jdt.internal.ui.viewsupport.ProjectTemplateStore; /** @@ -332,7 +333,7 @@ public class StubUtility { */ private static String[] getParameterTypeNamesForSeeTag(IMethod overridden) { try { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(overridden.getJavaProject()); IBinding[] bindings= parser.createBindings(new IJavaElement[] { overridden }, null); if (bindings.length == 1 && bindings[0] instanceof IMethodBinding) { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility2.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility2.java index 749198c4fe..e3a7aa63f0 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility2.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/StubUtility2.java @@ -80,7 +80,7 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.ui.CodeGeneration; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * Utilities for code generation based on AST rewrite. @@ -738,7 +738,7 @@ public final class StubUtility2 { // need an AST of the source method to preserve order of modifiers IMethod iMethod= (IMethod) method.getJavaElement(); if (iMethod != null && JavaElementUtil.isSourceAvailable(iMethod)) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(iMethod.getTypeRoot()); parser.setIgnoreMethodBodies(true); CompilationUnit otherCU= (CompilationUnit) parser.createAST(null); diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/tostringgeneration/GenerateToStringOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/tostringgeneration/GenerateToStringOperation.java index 4042b3632e..a2e75b6784 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/tostringgeneration/GenerateToStringOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/codemanipulation/tostringgeneration/GenerateToStringOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Mateusz Matela and others. + * Copyright (c) 2010, 2016 Mateusz Matela and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -41,7 +41,7 @@ import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationMessages; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite; -import org.eclipse.jdt.internal.corext.util.JavaModelUtil; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; /** @@ -101,7 +101,7 @@ public class GenerateToStringOperation implements IWorkspaceRunnable { } } - JavaModelUtil.applyEdit((ICompilationUnit)fUnit.getJavaElement(), fRewrite.createChange(true).getEdit(), false, monitor); + JavaElementUtil.applyEdit((ICompilationUnit)fUnit.getJavaElement(), fRewrite.createChange(true).getEdit(), false, monitor); } } finally { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTBatchParser.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTBatchParser.java index 28e9b542ed..665a99dd4f 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTBatchParser.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/ASTBatchParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,8 +27,6 @@ import org.eclipse.jdt.core.dom.ASTParser; import org.eclipse.jdt.core.dom.ASTRequestor; import org.eclipse.jdt.core.dom.IBinding; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; - /** * Creates AST from a set of compilation units. Uses the * batch parser. Splits the set of compilation units in subsets @@ -113,7 +111,7 @@ public class ASTBatchParser { * @return an AST parser capable of creating ASTs of compilation units in project */ protected ASTParser createParser(IJavaProject project) { - ASTParser result= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser result= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); result.setResolveBindings(true); result.setProject(project); diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/BodyDeclarationRewrite.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/BodyDeclarationRewrite.java index 12dc84f83a..c7a63058f7 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/BodyDeclarationRewrite.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/BodyDeclarationRewrite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,11 +17,15 @@ import org.eclipse.text.edits.TextEditGroup; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.BodyDeclaration; import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor; +import org.eclipse.jdt.core.dom.MethodDeclaration; +import org.eclipse.jdt.core.dom.Modifier; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; +import org.eclipse.jdt.internal.ui.JavaPlugin; +import org.eclipse.jdt.internal.ui.preferences.MembersOrderPreferenceCache; /** * Rewrite helper for body declarations. @@ -46,7 +50,84 @@ public class BodyDeclarationRewrite { public void insert(BodyDeclaration decl, TextEditGroup description) { List<BodyDeclaration> container= ASTNodes.getBodyDeclarations(fTypeNode); - int index= ASTNodes.getInsertionIndex(decl, container); + int index= getInsertionIndex(decl, container); fListRewrite.insertAt(decl, index, description); } + + /** + * Computes the insertion index to be used to add the given member to the + * the list <code>container</code>. + * @param member the member to add + * @param container a list containing objects of type <code>BodyDeclaration</code> + * @return the insertion index to be used + */ + public static int getInsertionIndex(BodyDeclaration member, List<? extends BodyDeclaration> container) { + int containerSize= container.size(); + + MembersOrderPreferenceCache orderStore= JavaPlugin.getDefault().getMemberOrderPreferenceCache(); + + int orderIndex= getOrderPreference(member, orderStore); + + int insertPos= containerSize; + int insertPosOrderIndex= -1; + + for (int i= containerSize - 1; i >= 0; i--) { + int currOrderIndex= getOrderPreference(container.get(i), orderStore); + if (orderIndex == currOrderIndex) { + if (insertPosOrderIndex != orderIndex) { // no perfect match yet + insertPos= i + 1; // after a same kind + insertPosOrderIndex= orderIndex; // perfect match + } + } else if (insertPosOrderIndex != orderIndex) { // not yet a perfect match + if (currOrderIndex < orderIndex) { // we are bigger + if (insertPosOrderIndex == -1) { + insertPos= i + 1; // after + insertPosOrderIndex= currOrderIndex; + } + } else { + insertPos= i; // before + insertPosOrderIndex= currOrderIndex; + } + } + } + return insertPos; + } + + private static int getOrderPreference(BodyDeclaration member, MembersOrderPreferenceCache store) { + int memberType= member.getNodeType(); + int modifiers= member.getModifiers(); + + switch (memberType) { + case ASTNode.TYPE_DECLARATION: + case ASTNode.ENUM_DECLARATION : + case ASTNode.ANNOTATION_TYPE_DECLARATION : + return store.getCategoryIndex(MembersOrderPreferenceCache.TYPE_INDEX) * 2; + case ASTNode.FIELD_DECLARATION: + if (Modifier.isStatic(modifiers)) { + int index= store.getCategoryIndex(MembersOrderPreferenceCache.STATIC_FIELDS_INDEX) * 2; + if (Modifier.isFinal(modifiers)) { + return index; // first final static, then static + } + return index + 1; + } + return store.getCategoryIndex(MembersOrderPreferenceCache.FIELDS_INDEX) * 2; + case ASTNode.INITIALIZER: + if (Modifier.isStatic(modifiers)) { + return store.getCategoryIndex(MembersOrderPreferenceCache.STATIC_INIT_INDEX) * 2; + } + return store.getCategoryIndex(MembersOrderPreferenceCache.INIT_INDEX) * 2; + case ASTNode.ANNOTATION_TYPE_MEMBER_DECLARATION: + return store.getCategoryIndex(MembersOrderPreferenceCache.METHOD_INDEX) * 2; + case ASTNode.METHOD_DECLARATION: + if (Modifier.isStatic(modifiers)) { + return store.getCategoryIndex(MembersOrderPreferenceCache.STATIC_METHODS_INDEX) * 2; + } + if (((MethodDeclaration) member).isConstructor()) { + return store.getCategoryIndex(MembersOrderPreferenceCache.CONSTRUCTORS_INDEX) * 2; + } + return store.getCategoryIndex(MembersOrderPreferenceCache.METHOD_INDEX) * 2; + default: + return 100; + } + } } diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpRefactoring.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpRefactoring.java index abc791d296..2b6404bc4d 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpRefactoring.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CleanUpRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -86,9 +86,9 @@ import org.eclipse.jdt.internal.ui.IJavaStatusConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.fix.IMultiFix.MultiFixContext; import org.eclipse.jdt.internal.ui.fix.MapCleanUpOptions; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.refactoring.IScheduledRefactoring; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class CleanUpRefactoring extends Refactoring implements IScheduledRefactoring { @@ -854,11 +854,11 @@ public class CleanUpRefactoring extends Refactoring implements IScheduledRefacto } public static ASTParser createCleanUpASTParser() { - ASTParser result= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser result= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); result.setResolveBindings(true); - result.setStatementsRecovery(ASTProvider.SHARED_AST_STATEMENT_RECOVERY); - result.setBindingsRecovery(ASTProvider.SHARED_BINDING_RECOVERY); + result.setStatementsRecovery(IASTSharedValues.SHARED_AST_STATEMENT_RECOVERY); + result.setBindingsRecovery(IASTSharedValues.SHARED_BINDING_RECOVERY); return result; } diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeStyleFix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeStyleFix.java index 6c5da0d0ec..bcf5fa2bbf 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeStyleFix.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/CodeStyleFix.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -67,9 +67,10 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; import org.eclipse.jdt.ui.text.java.IProblemLocation; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.ProblemLocation; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * A fix which fixes code style issues. diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertIterableLoopOperation.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertIterableLoopOperation.java index 2d04891622..12c92dbcd0 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertIterableLoopOperation.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertIterableLoopOperation.java @@ -58,8 +58,9 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Operation to convert for loops over iterables to enhanced for loops. diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ImportsFix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ImportsFix.java index 3580ba038d..d9cd0b6566 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ImportsFix.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ImportsFix.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,7 +30,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; import org.eclipse.jdt.internal.ui.actions.ActionMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class ImportsFix extends TextEditFix { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/Java50Fix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/Java50Fix.java index 91424b5777..b18a91ab2c 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/Java50Fix.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/Java50Fix.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -64,7 +64,7 @@ import org.eclipse.jdt.ui.text.java.IProblemLocation; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.text.correction.ProblemLocation; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Fix which introduce new language constructs to pre Java50 code. diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/LambdaExpressionsFix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/LambdaExpressionsFix.java index 8186cb7df0..e60058694a 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/LambdaExpressionsFix.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/LambdaExpressionsFix.java @@ -62,6 +62,7 @@ import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2; @@ -78,7 +79,6 @@ import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; public class LambdaExpressionsFix extends CompilationUnitRewriteOperationsFix { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/NullAnnotationsRewriteOperations.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/NullAnnotationsRewriteOperations.java index 8b6edf34b1..724bc4708c 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/NullAnnotationsRewriteOperations.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/NullAnnotationsRewriteOperations.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2013 GK Software AG and others. + * Copyright (c) 2011, 2016 GK Software AG and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -55,8 +55,8 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.text.java.IProblemLocation; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class NullAnnotationsRewriteOperations { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/PotentialProgrammingProblemsFix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/PotentialProgrammingProblemsFix.java index af978d6659..6064e94ece 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/PotentialProgrammingProblemsFix.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/PotentialProgrammingProblemsFix.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -63,10 +63,10 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; import org.eclipse.jdt.ui.text.java.IProblemLocation; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.text.correction.ProblemLocation; import org.eclipse.jdt.internal.ui.text.correction.SerialVersionHashOperation; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class PotentialProgrammingProblemsFix extends CompilationUnitRewriteOperationsFix { @@ -112,7 +112,7 @@ public class PotentialProgrammingProblemsFix extends CompilationUnitRewriteOpera throw new OperationCanceledException(); result= new RefactoringStatus(); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(fProject); IBinding[] bindings= parser.createBindings(types, new SubProgressMonitor(monitor, 1)); for (int i= 0; i < bindings.length; i++) { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnimplementedCodeFix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnimplementedCodeFix.java index 374e254c7e..afb0efd787 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnimplementedCodeFix.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnimplementedCodeFix.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -51,7 +51,7 @@ import org.eclipse.jdt.ui.cleanup.ICleanUpFix; import org.eclipse.jdt.ui.text.java.IProblemLocation; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class UnimplementedCodeFix extends CompilationUnitRewriteOperationsFix { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFix.java index ad0ad86187..958c454ed6 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFix.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/UnusedCodeFix.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -75,7 +75,7 @@ import org.eclipse.jdt.ui.text.java.IProblemLocation; import org.eclipse.jdt.internal.ui.fix.UnusedCodeCleanUp; import org.eclipse.jdt.internal.ui.text.correction.JavadocTagsSubProcessor; import org.eclipse.jdt.internal.ui.text.correction.ProblemLocation; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Fix which removes unused code. diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/VariableDeclarationFix.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/VariableDeclarationFix.java index 6cb627a965..f991f8111b 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/VariableDeclarationFix.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/VariableDeclarationFix.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -47,6 +47,7 @@ import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jdt.core.dom.VariableDeclarationStatement; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.GenericVisitor; import org.eclipse.jdt.internal.corext.dom.VariableDeclarationRewrite; @@ -54,8 +55,6 @@ import org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewr import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; - public class VariableDeclarationFix extends CompilationUnitRewriteOperationsFix { private static class WrittenNamesFinder extends GenericVisitor { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/CodeTemplateContextType.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/CodeTemplateContextType.java index a26b18c6ce..e57c8e8490 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/CodeTemplateContextType.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/CodeTemplateContextType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,7 +30,7 @@ import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.TokenScanner; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** */ diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/JavaContext.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/JavaContext.java index 3eab70fc92..2da692c544 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/JavaContext.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/JavaContext.java @@ -72,11 +72,12 @@ import org.eclipse.jdt.core.search.SearchEngine; import org.eclipse.jdt.core.search.SearchPattern; import org.eclipse.jdt.core.search.TypeNameMatch; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.template.java.CompilationUnitCompletion.Variable; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; -import org.eclipse.jdt.internal.corext.util.Strings; import org.eclipse.jdt.internal.corext.util.TypeNameMatchCollector; import org.eclipse.jdt.ui.JavaUI; @@ -647,7 +648,7 @@ public class JavaContext extends CompilationUnitContext { document.addPosition(position); try { - JavaModelUtil.applyEdit(cu, fImportRewrite.rewriteImports(null), false, null); + JavaElementUtil.applyEdit(cu, fImportRewrite.rewriteImports(null), false, null); setCompletionOffset(position.getOffset()); } catch (CoreException e) { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/JavaDocContext.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/JavaDocContext.java index f7fcf95b35..9b714d440a 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/JavaDocContext.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/JavaDocContext.java @@ -27,7 +27,7 @@ import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.PreferenceConstants; diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/History.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/History.java index af3c19fdf5..25a44dd794 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/History.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/History.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -52,7 +52,7 @@ import org.eclipse.jdt.internal.corext.CorextMessages; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIException; import org.eclipse.jdt.internal.ui.JavaUIStatus; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * History stores a list of key, object pairs. The list is bounded at size diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JDTUIHelperClasses.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JDTUIHelperClasses.java index b5a998e78c..eba8901950 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JDTUIHelperClasses.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/JDTUIHelperClasses.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013 IBM Corporation and others. + * Copyright (c) 2013, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -34,11 +34,19 @@ import org.eclipse.jdt.internal.corext.refactoring.structure.ASTNodeSearchUtil; import org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite; import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; - /** * The org.eclipse.jdt.ui bundle contains a few internal helper classes that simplify - * common tasks when dealing with JDT Core or UI APIs. Here's a list of the most important ones: + * common tasks when dealing with JDT Core or UI APIs. With bug 508777, many of these + * classes have been moved to the org.eclipse.jdt.core.manipulation bundle. We've kept + * the original package/class names to reduce binary compatibility problems for bundles + * that illegally accessed these classes. + * <p> + * Some classes had to be split in two. They are listed with fully-qualified names here. + * Back-links in Javadoc from classes in org.eclipse.jdt.core.manipulation to this + * class are not possible, so we use line comments there: // @see JDTUIHelperClasses + * </p> + * + * Here's a list of the most important helper classes: * * <h2>Java Model</h2> * <p> @@ -77,7 +85,8 @@ import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; * <ul> * <li>{@link ASTNodes}</li> * <li>{@link ASTNodeSearchUtil}</li> - * <li>{@link ASTResolving}</li> + * <li>{@link org.eclipse.jdt.internal.ui.text.correction.ASTResolving}</li> + * <li>{@link org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving}</li> * <li>{@link Bindings}</li> * <li>{@link TypeRules}</li> * </ul> @@ -112,6 +121,16 @@ import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; * <li>{@link VariableDeclarationRewrite}</li> * </ul> * + * <p> + * Label and text manipulation helpers: + * </p> + * <ul> + * <li>{@link org.eclipse.jdt.internal.corext.util.Strings}</li> + * <li>{@link org.eclipse.jdt.internal.core.manipulation.util.Strings}</li> + * <li>{@link org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels}</li> + * <li>{@link org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels}</li> + * </ul> + * * @noreference This class is not intended to be referenced by clients */ public final class JDTUIHelperClasses { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/Resources.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/Resources.java index 19d1472f80..bdcf06b226 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/Resources.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/Resources.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -37,7 +37,7 @@ import org.eclipse.jdt.internal.corext.CorextMessages; import org.eclipse.jdt.internal.ui.IJavaStatusConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIStatus; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class Resources { diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/Strings.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/Strings.java index 5028d317af..6b978612ea 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/Strings.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/Strings.java @@ -12,44 +12,19 @@ package org.eclipse.jdt.internal.corext.util; import org.eclipse.osgi.util.TextProcessor; -import org.eclipse.core.runtime.Assert; - import org.eclipse.jface.action.LegacyActionTools; import org.eclipse.jface.viewers.StyledString; import org.eclipse.jface.viewers.StyledString.Styler; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DefaultLineTracker; -import org.eclipse.jface.text.ILineTracker; -import org.eclipse.jface.text.IRegion; - -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.formatter.IndentManipulation; - - /** * Helper class to provide String manipulation functions not available in standard JDK. + * + * @see JDTUIHelperClasses */ -public class Strings { +public class Strings extends org.eclipse.jdt.internal.core.manipulation.util.Strings { private Strings(){} - - /** - * Tells whether we have to use the {@link TextProcessor} - * <p> - * This is used for performance optimization. - * </p> - * @since 3.4 - */ - public static final boolean USE_TEXT_PROCESSOR; - static { - String testString= "args : String[]"; //$NON-NLS-1$ - USE_TEXT_PROCESSOR= testString != TextProcessor.process(testString); - } - - private static final String JAVA_ELEMENT_DELIMITERS= TextProcessor.getDefaultDelimiters() + "<>(),?{} "; //$NON-NLS-1$ - /** * Sets the given <code>styler</code> to use for <code>matchingRegions</code> (obtained from * {@link org.eclipse.jdt.core.search.SearchPattern#getMatchingRegions}) in the @@ -167,493 +142,6 @@ public class Strings { } } - /** - * Adds special marks so that that the given string is readable in a BiDi environment. - * - * @param string the string - * @return the processed styled string - * @since 3.4 - */ - public static String markLTR(String string) { - if (!USE_TEXT_PROCESSOR) - return string; - - return TextProcessor.process(string); - } - - /** - * Adds special marks so that that the given string is readable in a BiDi environment. - * - * @param string the string - * @param delimiters the delimiters - * @return the processed styled string - * @since 3.4 - */ - public static String markLTR(String string, String delimiters) { - if (!USE_TEXT_PROCESSOR) - return string; - - return TextProcessor.process(string, delimiters); - } - - /** - * Adds special marks so that that the given Java element label is readable in a BiDi - * environment. - * - * @param string the string - * @return the processed styled string - * @since 3.6 - */ - public static String markJavaElementLabelLTR(String string) { - if (!USE_TEXT_PROCESSOR) - return string; - - return TextProcessor.process(string, JAVA_ELEMENT_DELIMITERS); - } - - /** - * Tests if a char is lower case. Fix for 26529. - * @param ch the char - * @return return true if char is lower case - */ - public static boolean isLowerCase(char ch) { - return Character.toLowerCase(ch) == ch; - } - - public static boolean startsWithIgnoreCase(String text, String prefix) { - int textLength= text.length(); - int prefixLength= prefix.length(); - if (textLength < prefixLength) - return false; - for (int i= prefixLength - 1; i >= 0; i--) { - if (Character.toLowerCase(prefix.charAt(i)) != Character.toLowerCase(text.charAt(i))) - return false; - } - return true; - } - - public static String removeNewLine(String message) { - StringBuffer result= new StringBuffer(); - int current= 0; - int index= message.indexOf('\n', 0); - while (index != -1) { - result.append(message.substring(current, index)); - if (current < index && index != 0) - result.append(' '); - current= index + 1; - index= message.indexOf('\n', current); - } - result.append(message.substring(current)); - return result.toString(); - } - - /** - * Converts the given string into an array of lines. The lines - * don't contain any line delimiter characters. - * - * @param input the string - * @return the string converted into an array of strings. Returns <code> - * null</code> if the input string can't be converted in an array of lines. - */ - public static String[] convertIntoLines(String input) { - try { - ILineTracker tracker= new DefaultLineTracker(); - tracker.set(input); - int size= tracker.getNumberOfLines(); - String result[]= new String[size]; - for (int i= 0; i < size; i++) { - IRegion region= tracker.getLineInformation(i); - int offset= region.getOffset(); - result[i]= input.substring(offset, offset + region.getLength()); - } - return result; - } catch (BadLocationException e) { - return null; - } - } - - /** - * Returns <code>true</code> if the given string only consists of - * white spaces according to Java. If the string is empty, <code>true - * </code> is returned. - * - * @param s the string to test - * @return <code>true</code> if the string only consists of white - * spaces; otherwise <code>false</code> is returned - * - * @see java.lang.Character#isWhitespace(char) - */ - public static boolean containsOnlyWhitespaces(String s) { - int size= s.length(); - for (int i= 0; i < size; i++) { - if (!Character.isWhitespace(s.charAt(i))) - return false; - } - return true; - } - - /** - * Removes leading tabs and spaces from the given string. If the string - * doesn't contain any leading tabs or spaces then the string itself is - * returned. - * @param line the line - * @return the trimmed line - */ - public static String trimLeadingTabsAndSpaces(String line) { - int size= line.length(); - int start= size; - for (int i= 0; i < size; i++) { - char c= line.charAt(i); - if (!IndentManipulation.isIndentChar(c)) { - start= i; - break; - } - } - if (start == 0) - return line; - else if (start == size) - return ""; //$NON-NLS-1$ - else - return line.substring(start); - } - - public static String trimTrailingTabsAndSpaces(String line) { - int size= line.length(); - int end= size; - for (int i= size - 1; i >= 0; i--) { - char c= line.charAt(i); - if (IndentManipulation.isIndentChar(c)) { - end= i; - } else { - break; - } - } - if (end == size) - return line; - else if (end == 0) - return ""; //$NON-NLS-1$ - else - return line.substring(0, end); - } - - /** - * Returns the indent of the given string in indentation units. Odd spaces - * are not counted. - * - * @param line the text line - * @param project the java project from which to get the formatter - * preferences, or <code>null</code> for global preferences - * @return the number of indent units - * @since 3.1 - */ - public static int computeIndentUnits(String line, IJavaProject project) { - return IndentManipulation.measureIndentUnits(line, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); - } - - /** - * Returns the indent of the given string in indentation units. Odd spaces - * are not counted. - * - * @param line the text line - * @param tabWidth the width of the '\t' character in space equivalents - * @param indentWidth the width of one indentation unit in space equivalents - * @return the indent of the given string in indentation units - * - * @since 3.1 - */ - public static int computeIndentUnits(String line, int tabWidth, int indentWidth) { - return IndentManipulation.measureIndentUnits(line, tabWidth, indentWidth); - } - - /** - * Computes the visual length of the indentation of a - * <code>CharSequence</code>, counting a tab character as the size until - * the next tab stop and every other whitespace character as one. - * - * @param line the string to measure the indent of - * @param tabSize the visual size of a tab in space equivalents - * @return the visual length of the indentation of <code>line</code> - * @since 3.1 - */ - public static int measureIndentLength(CharSequence line, int tabSize) { - return IndentManipulation.measureIndentInSpaces(line, tabSize); - } - - /** - * Removes the given number of indents from the line. Asserts that the given line - * has the requested number of indents. If <code>indentsToRemove <= 0</code> - * the line is returned. - * @param line the line - * @param indentsToRemove the indents to remove - * - * @param project the java project from which to get the formatter - * preferences, or <code>null</code> for global preferences - * @return the trimmed line - * - * @since 3.1 - */ - public static String trimIndent(String line, int indentsToRemove, IJavaProject project) { - return IndentManipulation.trimIndent(line, indentsToRemove, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); - } - - /** - * Removes the given number of indents from the line. Asserts that the given line - * has the requested number of indents. If <code>indentsToRemove <= 0</code> - * the line is returned. - * @param line the line - * @param indentsToRemove the indents to remove - * @param tabWidth the tab width - * @param indentWidth the indent width - * @return the trimmed line - * - * @since 3.1 - */ - public static String trimIndent(String line, int indentsToRemove, int tabWidth, int indentWidth) { - return IndentManipulation.trimIndent(line, indentsToRemove, tabWidth, indentWidth); - } - - /** - * Removes the common number of indents from all lines. If a line - * only consists out of white space it is ignored. - * @param lines the lines - - * @param project the java project from which to get the formatter - * preferences, or <code>null</code> for global preferences - * @since 3.1 - */ - public static void trimIndentation(String[] lines, IJavaProject project) { - trimIndentation(lines, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), true); - } - /** - * Removes the common number of indents from all lines. If a line - * only consists out of white space it is ignored. - * @param lines the lines - * @param tabWidth the size of one tab in space equivalents - * @param indentWidth the size of the indent in space equivalents - * - * @since 3.1 - */ - public static void trimIndentation(String[] lines, int tabWidth, int indentWidth) { - trimIndentation(lines, tabWidth, indentWidth, true); - } - - /** - * Removes the common number of indents from all lines. If a line - * only consists out of white space it is ignored. If <code> - * considerFirstLine</code> is false the first line will be ignored. - * @param lines the lines - * - * @param project the java project from which to get the formatter - * preferences, or <code>null</code> for global preferences - * @param considerFirstLine If <code>considerFirstLine</code> is false the first line will be ignored. - * @since 3.1 - */ - public static void trimIndentation(String[] lines, IJavaProject project, boolean considerFirstLine) { - trimIndentation(lines, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), considerFirstLine); - } - - /** - * Removes the common number of indents from all lines. If a line - * only consists out of white space it is ignored. If <code> - * considerFirstLine</code> is false the first line will be ignored. - * @param lines the lines - * @param tabWidth the size of one tab in space equivalents - * @param indentWidth the size of the indent in space equivalents - * @param considerFirstLine If <code> considerFirstLine</code> is false the first line will be ignored. - * @since 3.1 - */ - public static void trimIndentation(String[] lines, int tabWidth, int indentWidth, boolean considerFirstLine) { - String[] toDo= new String[lines.length]; - // find indentation common to all lines - int minIndent= Integer.MAX_VALUE; // very large - for (int i= considerFirstLine ? 0 : 1; i < lines.length; i++) { - String line= lines[i]; - if (containsOnlyWhitespaces(line)) - continue; - toDo[i]= line; - int indent= computeIndentUnits(line, tabWidth, indentWidth); - if (indent < minIndent) { - minIndent= indent; - } - } - - if (minIndent > 0) { - // remove this indent from all lines - for (int i= considerFirstLine ? 0 : 1; i < toDo.length; i++) { - String s= toDo[i]; - if (s != null) - lines[i]= trimIndent(s, minIndent, tabWidth, indentWidth); - else { - String line= lines[i]; - int indent= computeIndentUnits(line, tabWidth, indentWidth); - if (indent > minIndent) - lines[i]= trimIndent(line, minIndent, tabWidth, indentWidth); - else - lines[i]= trimLeadingTabsAndSpaces(line); - } - } - } - } - - /** - * Returns that part of the indentation of <code>line</code> that makes up - * a multiple of indentation units. - * - * @param line the line to scan - * @param project the java project from which to get the formatter - * preferences, or <code>null</code> for global preferences - * @return the indent part of <code>line</code>, but no odd spaces - * @since 3.1 - */ - public static String getIndentString(String line, IJavaProject project) { - return IndentManipulation.extractIndentString(line, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project)); - } - - /** - * Returns that part of the indentation of <code>line</code> that makes up - * a multiple of indentation units. - * - * @param line the line to scan - * @param tabWidth the size of one tab in space equivalents - * @param indentWidth the size of the indent in space equivalents - * @return the indent part of <code>line</code>, but no odd spaces - * @since 3.1 - */ - public static String getIndentString(String line, int tabWidth, int indentWidth) { - return IndentManipulation.extractIndentString(line, tabWidth, indentWidth); - } - - public static String[] removeTrailingEmptyLines(String[] sourceLines) { - int lastNonEmpty= findLastNonEmptyLineIndex(sourceLines); - String[] result= new String[lastNonEmpty + 1]; - for (int i= 0; i < result.length; i++) { - result[i]= sourceLines[i]; - } - return result; - } - - private static int findLastNonEmptyLineIndex(String[] sourceLines) { - for (int i= sourceLines.length - 1; i >= 0; i--) { - if (! sourceLines[i].trim().equals(""))//$NON-NLS-1$ - return i; - } - return -1; - } - - /** - * Change the indent of, possible multi-line, code range. The current indent is removed, a new indent added. - * The first line of the code will not be changed. (It is considered to have no indent as it might start in - * the middle of a line) - * @param code the code - * @param codeIndentLevel level of indentation - * - * @param project the java project from which to get the formatter - * preferences, or <code>null</code> for global preferences - * @param newIndent new indent - * @param lineDelim line delimiter - * @return the changed code - * @since 3.1 - */ - public static String changeIndent(String code, int codeIndentLevel, IJavaProject project, String newIndent, String lineDelim) { - return IndentManipulation.changeIndent(code, codeIndentLevel, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), newIndent, lineDelim); - } - - /** - * Change the indent of, possible muti-line, code range. The current indent is removed, a new indent added. - * The first line of the code will not be changed. (It is considered to have no indent as it might start in - * the middle of a line) - * @param code the code - * @param codeIndentLevel indent level - * @param tabWidth the size of one tab in space equivalents - * @param indentWidth the size of the indent in space equivalents - * @param newIndent new indent - * @param lineDelim line delimiter - * @return the changed code - * @since 3.1 - */ - public static String changeIndent(String code, int codeIndentLevel, int tabWidth, int indentWidth, String newIndent, String lineDelim) { - return IndentManipulation.changeIndent(code, codeIndentLevel, tabWidth, indentWidth, newIndent, lineDelim); - } - - public static String trimIndentation(String source, IJavaProject project, boolean considerFirstLine) { - return trimIndentation(source, CodeFormatterUtil.getTabWidth(project), CodeFormatterUtil.getIndentWidth(project), considerFirstLine); - } - - public static String trimIndentation(String source, int tabWidth, int indentWidth, boolean considerFirstLine) { - try { - ILineTracker tracker= new DefaultLineTracker(); - tracker.set(source); - int size= tracker.getNumberOfLines(); - if (size == 1) - return source; - String lines[]= new String[size]; - for (int i= 0; i < size; i++) { - IRegion region= tracker.getLineInformation(i); - int offset= region.getOffset(); - lines[i]= source.substring(offset, offset + region.getLength()); - } - Strings.trimIndentation(lines, tabWidth, indentWidth, considerFirstLine); - StringBuffer result= new StringBuffer(); - int last= size - 1; - for (int i= 0; i < size; i++) { - result.append(lines[i]); - if (i < last) - result.append(tracker.getLineDelimiter(i)); - } - return result.toString(); - } catch (BadLocationException e) { - Assert.isTrue(false,"Can not happend"); //$NON-NLS-1$ - return null; - } - } - - - /** - * Concatenate the given strings into one strings using the passed line delimiter as a - * delimiter. No delimiter is added to the last line. - * @param lines the lines - * @param delimiter line delimiter - * @return the concatenated lines - */ - public static String concatenate(String[] lines, String delimiter) { - StringBuffer buffer= new StringBuffer(); - for (int i= 0; i < lines.length; i++) { - if (i > 0) - buffer.append(delimiter); - buffer.append(lines[i]); - } - return buffer.toString(); - } - - public static boolean equals(String s, char[] c) { - if (s.length() != c.length) - return false; - - for (int i = c.length; --i >= 0;) - if (s.charAt(i) != c[i]) - return false; - return true; - } - - public static String removeTrailingCharacters(String text, char toRemove) { - int size= text.length(); - int end= size; - for (int i= size - 1; i >= 0; i--) { - char c= text.charAt(i); - if (c == toRemove) { - end= i; - } else { - break; - } - } - if (end == size) - return text; - else if (end == 0) - return ""; //$NON-NLS-1$ - else - return text.substring(0, end); - } - public static String removeMnemonicIndicator(String string) { return LegacyActionTools.removeMnemonics(string); } diff --git a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/TypeInfoFilter.java b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/TypeInfoFilter.java index 6251687da8..7d9555cb19 100644 --- a/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/TypeInfoFilter.java +++ b/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/TypeInfoFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,6 +17,8 @@ import org.eclipse.jdt.core.search.SearchEngine; import org.eclipse.jdt.core.search.SearchPattern; import org.eclipse.jdt.core.search.TypeNameMatch; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; + import org.eclipse.jdt.ui.dialogs.ITypeInfoFilterExtension; import org.eclipse.jdt.internal.ui.util.PatternMatcher; diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/Checks.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/Checks.java index 2c9c9f14bc..3df1b00857 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/Checks.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/Checks.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -71,8 +71,8 @@ import org.eclipse.jdt.internal.corext.util.Resources; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * This class defines a set of reusable static checks methods. diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/JDTRefactoringDescriptorComment.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/JDTRefactoringDescriptorComment.java index e9d9159a02..5a99c3fc2e 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/JDTRefactoringDescriptorComment.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/JDTRefactoringDescriptorComment.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -35,7 +35,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Helper class to generate a refactoring descriptor comment. diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringSearchEngine2.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringSearchEngine2.java index 5340005f88..08f7febca9 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringSearchEngine2.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringSearchEngine2.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -48,7 +48,7 @@ import org.eclipse.jdt.core.search.SearchRequestor; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.SearchUtils; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Helper class to use the search engine in refactorings. diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypeContextChecker.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypeContextChecker.java index 762d63bc06..e4bf48d3fa 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypeContextChecker.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypeContextChecker.java @@ -86,9 +86,9 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.TypeNameMatchCollector; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class TypeContextChecker { private static class MethodTypesChecker { @@ -171,7 +171,7 @@ public class TypeContextChecker { ICompilationUnit wc= fMethod.getCompilationUnit().getWorkingCopy(new WorkingCopyOwner() {/*subclass*/}, new NullProgressMonitor()); try { wc.getBuffer().setContents(cuString.toString()); - CompilationUnit compilationUnit= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(wc, true); + CompilationUnit compilationUnit= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(wc, true); ASTNode method= NodeFinder.perform(compilationUnit, offsetBeforeMethodName, METHOD_NAME.length()).getParent(); Type[] typeNodes= new Type[types.length]; if (method instanceof MethodDeclaration) { @@ -437,7 +437,7 @@ public class TypeContextChecker { int offset= cuBuff.length(); cuBuff.append(typeString).append(" m();}"); //$NON-NLS-1$ - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setSource(cuBuff.toString().toCharArray()); p.setProject(javaProject); CompilationUnit cu= (CompilationUnit) p.createAST(null); @@ -679,7 +679,7 @@ public class TypeContextChecker { ISourceRange typeSourceRange= enclosingType.getSourceRange(); int focalPosition= typeSourceRange.getOffset() + typeSourceRange.getLength() - 1; // before closing brace - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setFocalPosition(focalPosition); CompilationUnit compilationUnit= (CompilationUnit) parser.createAST(null); @@ -741,7 +741,7 @@ public class TypeContextChecker { int offset= cuBuff.length(); cuBuff.append(superType).append(" {}"); //$NON-NLS-1$ - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setSource(cuBuff.toString().toCharArray()); Map<String, String> options= new HashMap<>(); JavaModelUtil.setComplianceOptions(options, JavaModelUtil.VERSION_LATEST); @@ -775,7 +775,7 @@ public class TypeContextChecker { ICompilationUnit wc= typeHandle.getCompilationUnit().getWorkingCopy(new WorkingCopyOwner() {/*subclass*/}, new NullProgressMonitor()); try { wc.getBuffer().setContents(cuString.toString()); - CompilationUnit compilationUnit= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(wc, true); + CompilationUnit compilationUnit= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(wc, true); ASTNode type= NodeFinder.perform(compilationUnit, superClassContext.getBeforeString().length(), superclass.length()); if (type instanceof Type) { return handleBug84585(((Type) type).resolveBinding()); @@ -812,7 +812,7 @@ public class TypeContextChecker { ICompilationUnit wc= typeHandle.getCompilationUnit().getWorkingCopy(new WorkingCopyOwner() {/*subclass*/}, new NullProgressMonitor()); try { wc.getBuffer().setContents(cuString.toString()); - CompilationUnit compilationUnit= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(wc, true); + CompilationUnit compilationUnit= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(wc, true); for (int i= 0; i <= last; i++) { ASTNode type= NodeFinder.perform(compilationUnit, interfaceOffsets[i], interfaces[i].length()); if (type instanceof Type) { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypedSource.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypedSource.java index dd21c10b59..35aa7f1afd 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypedSource.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/TypedSource.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -36,9 +36,9 @@ import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgUtils; import org.eclipse.jdt.internal.corext.refactoring.structure.ASTNodeSearchUtil; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * A tuple used to keep source of an element and its type. @@ -159,7 +159,7 @@ public class TypedSource { return source; } else { if (tuple.node == null) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(tuple.unit); tuple.node= (CompilationUnit) parser.createAST(null); } diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyCompilationUnitChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyCompilationUnitChange.java index d1142d0b71..11d1a440e1 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyCompilationUnitChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyCompilationUnitChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -23,7 +23,7 @@ import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.refactoring.reorg.INewNameQuery; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class CopyCompilationUnitChange extends CompilationUnitReorgChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyPackageFragmentRootChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyPackageFragmentRootChange.java index 8144d86390..adbbd242bf 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyPackageFragmentRootChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyPackageFragmentRootChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,7 +27,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class CopyPackageFragmentRootChange extends PackageFragmentRootReorgChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyResourceChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyResourceChange.java index 84465bcf84..16874ae526 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyResourceChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CopyResourceChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -32,7 +32,7 @@ import org.eclipse.jdt.internal.corext.refactoring.reorg.INewNameQuery; import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgUtils; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class CopyResourceChange extends ResourceChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CreateCompilationUnitChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CreateCompilationUnitChange.java index d0665c45e5..896a6eb2ee 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CreateCompilationUnitChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/CreateCompilationUnitChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -16,7 +16,7 @@ import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.refactoring.nls.changes.CreateTextFileChange; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class CreateCompilationUnitChange extends CreateTextFileChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/DeletePackageFragmentRootChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/DeletePackageFragmentRootChange.java index 3cd51354ac..8cbf55f6b0 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/DeletePackageFragmentRootChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/DeletePackageFragmentRootChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -57,7 +57,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class DeletePackageFragmentRootChange extends AbstractDeleteChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MoveCompilationUnitChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MoveCompilationUnitChange.java index f54d51e061..f63b49cf5a 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MoveCompilationUnitChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MoveCompilationUnitChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -28,7 +28,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class MoveCompilationUnitChange extends CompilationUnitReorgChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MovePackageFragmentRootChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MovePackageFragmentRootChange.java index 77ff8f01bc..14cc198c20 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MovePackageFragmentRootChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MovePackageFragmentRootChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -26,7 +26,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class MovePackageFragmentRootChange extends PackageFragmentRootReorgChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MultiStateCompilationUnitChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MultiStateCompilationUnitChange.java index b5e4416473..60c236600d 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MultiStateCompilationUnitChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/MultiStateCompilationUnitChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 IBM Corporation and others. + * Copyright (c) 2005, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,7 +19,7 @@ import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Multi state compilation unit change for composite refactorings. diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameCompilationUnitChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameCompilationUnitChange.java index 6cb965d1d7..7e8aaf450b 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameCompilationUnitChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameCompilationUnitChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -26,7 +26,7 @@ import org.eclipse.jdt.internal.corext.refactoring.AbstractJavaElementRenameChan import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class RenameCompilationUnitChange extends AbstractJavaElementRenameChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameJavaProjectChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameJavaProjectChange.java index 7872598e74..3db53f0af6 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameJavaProjectChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameJavaProjectChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -31,7 +31,7 @@ import org.eclipse.jdt.internal.corext.refactoring.AbstractJavaElementRenameChan import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class RenameJavaProjectChange extends AbstractJavaElementRenameChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenamePackageChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenamePackageChange.java index 05856ce1a8..1c0d243db1 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenamePackageChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenamePackageChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -42,7 +42,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class RenamePackageChange extends AbstractJavaElementRenameChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameSourceFolderChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameSourceFolderChange.java index e88828b7b4..dd37546fa1 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameSourceFolderChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/RenameSourceFolderChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -28,7 +28,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class RenameSourceFolderChange extends AbstractJavaElementRenameChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/UndoDeleteResourceChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/UndoDeleteResourceChange.java index 64e31df4f4..29d4c42bb0 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/UndoDeleteResourceChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/changes/UndoDeleteResourceChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -26,7 +26,7 @@ import org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange; import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class UndoDeleteResourceChange extends Change { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/CodeRefactoringUtil.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/CodeRefactoringUtil.java index b8b221bb51..c4c0331563 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/CodeRefactoringUtil.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/CodeRefactoringUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -34,10 +34,10 @@ import org.eclipse.jdt.internal.corext.dom.Selection; import org.eclipse.jdt.internal.corext.dom.SelectionAnalyzer; import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class CodeRefactoringUtil { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ConvertAnonymousToNestedRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ConvertAnonymousToNestedRefactoring.java index 576e5b1788..b43017431c 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ConvertAnonymousToNestedRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ConvertAnonymousToNestedRefactoring.java @@ -112,7 +112,7 @@ import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; public class ConvertAnonymousToNestedRefactoring extends Refactoring { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractConstantRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractConstantRefactoring.java index e849ff84ea..6ed68eb68b 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractConstantRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractConstantRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -74,6 +74,8 @@ import org.eclipse.jdt.core.refactoring.IJavaRefactorings; import org.eclipse.jdt.core.refactoring.descriptors.ExtractConstantDescriptor; import org.eclipse.jdt.core.refactoring.descriptors.JavaRefactoringDescriptor; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatureDescriptorFactory; import org.eclipse.jdt.internal.corext.Corext; import org.eclipse.jdt.internal.corext.SourceRangeFactory; @@ -81,6 +83,7 @@ import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRe import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.corext.dom.ScopeAnalyzer; import org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory; import org.eclipse.jdt.internal.corext.dom.fragments.IASTFragment; @@ -102,11 +105,8 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.CodeGeneration; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; public class ExtractConstantRefactoring extends Refactoring { @@ -482,7 +482,7 @@ public class ExtractConstantRefactoring extends Refactoring { private void checkSource(SubProgressMonitor monitor, RefactoringStatus result) throws CoreException { String newCuSource= fChange.getPreviewContent(new NullProgressMonitor()); - CompilationUnit newCUNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(newCuSource, fCu, true, true, monitor); + CompilationUnit newCUNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(newCuSource, fCu, true, true, monitor); IProblem[] newProblems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, fCuRewrite.getRoot()); for (int i= 0; i < newProblems.length; i++) { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.java index e6367f59f3..4797dbda09 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -96,8 +96,8 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; /* package */ class ExtractMethodAnalyzer extends CodeAnalyzer { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java index 884aef141e..e2a75e3ffa 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -127,9 +127,10 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; /** diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java index 9a1d29fd16..99602d9ac0 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -134,9 +134,9 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; /** @@ -563,7 +563,7 @@ public class ExtractTempRefactoring extends Refactoring { private void checkNewSource(SubProgressMonitor monitor, RefactoringStatus result) throws CoreException { String newCuSource= fChange.getPreviewContent(new NullProgressMonitor()); - CompilationUnit newCUNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(newCuSource, fCu, true, true, monitor); + CompilationUnit newCUNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(newCuSource, fCu, true, true, monitor); IProblem[] newProblems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, fCompilationUnitNode); for (int i= 0; i < newProblems.length; i++) { IProblem problem= newProblems[i]; diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineConstantRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineConstantRefactoring.java index a7c61f273f..b647e36338 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineConstantRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineConstantRefactoring.java @@ -123,12 +123,12 @@ import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; import org.eclipse.jdt.internal.corext.refactoring.util.TightSourceRangeComputer; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class InlineConstantRefactoring extends Refactoring { @@ -1032,7 +1032,7 @@ public class InlineConstantRefactoring extends Refactoring { fSelectionCu= field.getCompilationUnit(); } else return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { handle, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT})); - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setResolveBindings(true); parser.setSource(fSelectionCu); final CompilationUnit unit= (CompilationUnit) parser.createAST(null); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineMethodRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineMethodRefactoring.java index 21c1210414..f5adfd52fa 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineMethodRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineMethodRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -81,8 +81,8 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; /* @@ -415,7 +415,7 @@ public class InlineMethodRefactoring extends Refactoring { CompilationUnit methodDeclarationAstRoot; ICompilationUnit methodCu= method.getCompilationUnit(); if (methodCu != null) { - methodDeclarationAstRoot= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(methodCu, true); + methodDeclarationAstRoot= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(methodCu, true); } else { IClassFile classFile= method.getClassFile(); if (! JavaElementUtil.isSourceAvailable(classFile)) { @@ -423,7 +423,7 @@ public class InlineMethodRefactoring extends Refactoring { status.addFatalError(Messages.format(RefactoringCoreMessages.InlineMethodRefactoring_error_classFile, methodLabel)); return null; } - methodDeclarationAstRoot= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(classFile, true); + methodDeclarationAstRoot= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(classFile, true); } ASTNode node= methodDeclarationAstRoot.findDeclaringNode(methodBinding.getMethodDeclaration().getKey()); if (node instanceof MethodDeclaration) { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineTempRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineTempRefactoring.java index 74881c9556..d017df9f27 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineTempRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/InlineTempRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -95,12 +95,12 @@ import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; import org.eclipse.jdt.internal.corext.refactoring.util.TightSourceRangeComputer; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; public class InlineTempRefactoring extends Refactoring { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceFactoryRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceFactoryRefactoring.java index 2f1c01aeea..9a5c76c37a 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceFactoryRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceFactoryRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -94,6 +94,7 @@ import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; +import org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite; import org.eclipse.jdt.internal.corext.dom.ModifierRewrite; import org.eclipse.jdt.internal.corext.refactoring.Checks; import org.eclipse.jdt.internal.corext.refactoring.JDTRefactoringDescriptorComment; @@ -116,7 +117,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaUIStatus; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; /** @@ -1147,7 +1148,7 @@ public class IntroduceFactoryRefactoring extends Refactoring { AbstractTypeDeclaration factoryOwner= (AbstractTypeDeclaration) unit.findDeclaringNode(fFactoryOwningClass.resolveBinding().getKey()); fImportRewriter.addImport(fCtorOwningClass.resolveBinding()); - int idx= ASTNodes.getInsertionIndex(fFactoryMethod, factoryOwner.bodyDeclarations()); + int idx= BodyDeclarationRewrite.getInsertionIndex(fFactoryMethod, factoryOwner.bodyDeclarations()); if (idx < 0) idx= 0; // Guard against bug in getInsertionIndex() unitRewriter.getListRewrite(factoryOwner, factoryOwner.getBodyDeclarationsProperty()).insertAt(fFactoryMethod, idx, gd); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceIndirectionRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceIndirectionRefactoring.java index 8a7a83facf..235bf656e4 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceIndirectionRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceIndirectionRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -91,6 +91,7 @@ import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; +import org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite; import org.eclipse.jdt.internal.corext.refactoring.Checks; import org.eclipse.jdt.internal.corext.refactoring.JDTRefactoringDescriptorComment; import org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments; @@ -118,9 +119,9 @@ import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * @@ -400,7 +401,7 @@ public class IntroduceIndirectionRefactoring extends Refactoring { selectionNode= getSelectedNode(fSelectionCompilationUnit, selectionCURoot, fSelectionStart, fSelectionLength); } else { // binary class file - no cu rewrite - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setResolveBindings(true); parser.setSource(fSelectionClassFile); selectionCURoot= (CompilationUnit) parser.createAST(null); @@ -443,7 +444,7 @@ public class IntroduceIndirectionRefactoring extends Refactoring { fTargetMethodBinding= declaration.resolveBinding().getMethodDeclaration(); } else { // binary method - no CURewrite available (and none needed as we cannot update the method anyway) - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(fTargetMethod.getJavaProject()); IBinding[] bindings= parser.createBindings(new IJavaElement[] { fTargetMethod }, null); fTargetMethodBinding= ((IMethodBinding) bindings[0]).getMethodDeclaration(); @@ -875,7 +876,7 @@ public class IntroduceIndirectionRefactoring extends Refactoring { ChildListPropertyDescriptor typeBodyDeclarationsProperty= typeToBodyDeclarationProperty(fIntermediaryType, imRewrite.getRoot()); ListRewrite bodyDeclarationsListRewrite= imRewrite.getASTRewrite().getListRewrite(type, typeBodyDeclarationsProperty); - bodyDeclarationsListRewrite.insertAt(intermediary, ASTNodes.getInsertionIndex(intermediary, type.bodyDeclarations()), imRewrite + bodyDeclarationsListRewrite.insertAt(intermediary, BodyDeclarationRewrite.getInsertionIndex(intermediary, type.bodyDeclarations()), imRewrite .createGroupDescription(RefactoringCoreMessages.IntroduceIndirectionRefactoring_group_description_create_new_method)); } diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceParameterRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceParameterRefactoring.java index 39ee7659b1..9c1068c59f 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceParameterRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/IntroduceParameterRefactoring.java @@ -96,7 +96,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.SelectionConverter; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class IntroduceParameterRefactoring extends Refactoring implements IDelegateUpdating { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java index 713eb27a5f..3e308f3486 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/PromoteTempToFieldRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -99,8 +99,8 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; public class PromoteTempToFieldRefactoring extends Refactoring { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ReplaceInvocationsRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ReplaceInvocationsRefactoring.java index 8871ce2104..c36144ee08 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ReplaceInvocationsRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ReplaceInvocationsRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -85,8 +85,8 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; public class ReplaceInvocationsRefactoring extends Refactoring { @@ -190,7 +190,7 @@ public class ReplaceInvocationsRefactoring extends Refactoring { return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReplaceInvocationsRefactoring_cannot_replace_in_binary); ICompilationUnit cu= (ICompilationUnit) fSelectionTypeRoot; - CompilationUnit root= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(cu, true); + CompilationUnit root= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(cu, true); fSelectionNode= getTargetNode(cu, root, fSelectionStart, fSelectionLength); if (fSelectionNode == null) return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReplaceInvocationsRefactoring_select_method_to_apply); @@ -209,7 +209,7 @@ public class ReplaceInvocationsRefactoring extends Refactoring { fMethod= (IMethod) fMethodBinding.getJavaElement(); } else { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(fMethod.getJavaProject()); IBinding[] bindings= parser.createBindings(new IJavaElement[] { fMethod }, null); fMethodBinding= (IMethodBinding) bindings[0]; @@ -233,7 +233,7 @@ public class ReplaceInvocationsRefactoring extends Refactoring { ICompilationUnit methodCu= (method).getCompilationUnit(); if (methodCu != null) { typeRoot= methodCu; - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(methodCu); parser.setFocalPosition(method.getNameRange().getOffset()); CompilationUnit compilationUnit= (CompilationUnit) parser.createAST(null); @@ -259,7 +259,7 @@ public class ReplaceInvocationsRefactoring extends Refactoring { } source= document; - methodDeclarationAstRoot= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(source.get(), methodCu, true, true, null); + methodDeclarationAstRoot= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(source.get(), methodCu, true, true, null); } else { IClassFile classFile= method.getClassFile(); @@ -288,7 +288,7 @@ public class ReplaceInvocationsRefactoring extends Refactoring { String stub= stubCreator.createStub(classFile.getType(), null); source= new Document(stub); - methodDeclarationAstRoot= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(stub, classFile, true, true, null); + methodDeclarationAstRoot= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(stub, classFile, true, true, null); typeRoot= classFile; } ASTNode node= methodDeclarationAstRoot.findDeclaringNode(methodBinding.getKey()); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/SnippetFinder.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/SnippetFinder.java index 6314f34f7d..1597e66a0a 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/SnippetFinder.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/SnippetFinder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -37,12 +37,11 @@ import org.eclipse.jdt.core.dom.SimpleName; import org.eclipse.jdt.core.dom.SuperFieldAccess; import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.dom.GenericVisitor; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; - /* package */ class SnippetFinder extends GenericVisitor { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/SourceProvider.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/SourceProvider.java index 00b7d36828..9803e49f4f 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/SourceProvider.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/SourceProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -89,7 +89,7 @@ import org.eclipse.jdt.internal.corext.dom.NecessaryParenthesesChecker; import org.eclipse.jdt.internal.corext.refactoring.code.SourceAnalyzer.NameData; import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringFileBuffers; import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.ui.JavaPlugin; diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/delegates/DelegateCreator.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/delegates/DelegateCreator.java index 4b0fe0fa3b..e4dceacd51 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/delegates/DelegateCreator.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/delegates/DelegateCreator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -49,7 +49,7 @@ import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewrite; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsRefactoring.java index 46b970daf3..4d2c301efd 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -90,8 +90,8 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.IJavaStatusConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class InferTypeArgumentsRefactoring extends Refactoring { @@ -185,7 +185,7 @@ public class InferTypeArgumentsRefactoring extends Refactoring { final SubProgressMonitor batchMonitor= new SubProgressMonitor(projectMonitor, 1); batchMonitor.subTask(RefactoringCoreMessages.InferTypeArgumentsRefactoring_calculating_dependencies); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(project); parser.setCompilerOptions(RefactoringASTParser.getCompilerOptions(project)); parser.setResolveBindings(true); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/AccessorClassCreator.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/AccessorClassCreator.java index 2ff504863a..7e32ef136c 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/AccessorClassCreator.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/AccessorClassCreator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -45,7 +45,7 @@ import org.eclipse.jdt.core.formatter.CodeFormatter; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.refactoring.nls.changes.CreateTextFileChange; import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil; -import org.eclipse.jdt.internal.corext.util.JavaModelUtil; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.ui.CodeGeneration; @@ -142,7 +142,7 @@ public class AccessorClassCreator { is.addImport("java.util.ResourceBundle"); //$NON-NLS-1$ } TextEdit edit= is.rewriteImports(pm); - JavaModelUtil.applyEdit(newCu, edit, false, null); + JavaElementUtil.applyEdit(newCu, edit, false, null); } private String createClass(String lineDelim) throws CoreException { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/AccessorClassModifier.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/AccessorClassModifier.java index a8f6a4b05f..6d00f55cfb 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/AccessorClassModifier.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/AccessorClassModifier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -59,7 +59,7 @@ import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.ui.SharedASTProvider; import org.eclipse.jdt.internal.ui.IJavaStatusConstants; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class AccessorClassModifier { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSPropertyFileModifier.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSPropertyFileModifier.java index 68eae5b628..7426334996 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSPropertyFileModifier.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSPropertyFileModifier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -41,7 +41,7 @@ import org.eclipse.jdt.internal.corext.refactoring.changes.TextChangeCompatibili import org.eclipse.jdt.internal.corext.refactoring.nls.changes.CreateTextFileChange; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class NLSPropertyFileModifier { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSRefactoring.java index 1a58281f96..b1a62b40bc 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -48,7 +48,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.SharedASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class NLSRefactoring extends Refactoring { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSSourceModifier.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSSourceModifier.java index c40fafffda..4c0889be4b 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSSourceModifier.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/NLSSourceModifier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,7 +40,7 @@ import org.eclipse.jdt.internal.corext.refactoring.changes.TextChangeCompatibili import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class NLSSourceModifier { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/PropertyFileDocumentModel.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/PropertyFileDocumentModel.java index 6543dca91f..4a842e368c 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/PropertyFileDocumentModel.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/PropertyFileDocumentModel.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -31,10 +31,10 @@ import org.eclipse.ltk.core.refactoring.TextChange; import org.eclipse.jdt.internal.corext.refactoring.changes.TextChangeCompatibility; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.ui.propertiesfileeditor.PropertiesFileEscapes; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class PropertyFileDocumentModel { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/changes/CreateFileChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/changes/CreateFileChange.java index 463d143d33..f97419d527 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/changes/CreateFileChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/nls/changes/CreateFileChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -42,7 +42,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class CreateFileChange extends ResourceChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RefactoringAnalyzeUtil.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RefactoringAnalyzeUtil.java index 14758ac393..2e77cf8bf6 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RefactoringAnalyzeUtil.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RefactoringAnalyzeUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,7 +39,7 @@ import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.refactoring.base.JavaStringStatusContext; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class RefactoringAnalyzeUtil { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameAnalyzeUtil.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameAnalyzeUtil.java index be58941959..6cbf130b40 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameAnalyzeUtil.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameAnalyzeUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -69,8 +69,8 @@ import org.eclipse.jdt.internal.corext.refactoring.util.TextChangeManager; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.SearchUtils; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; class RenameAnalyzeUtil { @@ -417,7 +417,7 @@ class RenameAnalyzeUtil { ICompilationUnit compilationUnit= (ICompilationUnit) oldCUNode.getJavaElement(); String newCuSource= cuChange.getPreviewContent(new NullProgressMonitor()); - CompilationUnit newCUNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(newCuSource, compilationUnit, true, recovery, null); + CompilationUnit newCUNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(newCuSource, compilationUnit, true, recovery, null); result.merge(analyzeCompileErrors(newCuSource, newCUNode, oldCUNode)); if (result.hasError()) diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameCompilationUnitProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameCompilationUnitProcessor.java index 316534e04c..64f7f3d689 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameCompilationUnitProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameCompilationUnitProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -63,7 +63,7 @@ import org.eclipse.jdt.ui.refactoring.IRefactoringProcessorIds; import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class RenameCompilationUnitProcessor extends JavaRenameProcessor implements IReferenceUpdating, ITextUpdating, IQualifiedNameUpdating, ISimilarDeclarationUpdating, IResourceMapper, IJavaElementMapper { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameEnumConstProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameEnumConstProcessor.java index fea557b388..da2713a99c 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameEnumConstProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameEnumConstProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -38,7 +38,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.ui.refactoring.IRefactoringProcessorIds; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class RenameEnumConstProcessor extends RenameFieldProcessor { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameFieldProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameFieldProcessor.java index a0240af603..e1b657ebcd 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameFieldProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameFieldProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -96,7 +96,7 @@ import org.eclipse.jdt.ui.refactoring.IRefactoringProcessorIds; import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class RenameFieldProcessor extends JavaRenameProcessor implements IReferenceUpdating, ITextUpdating, IDelegateUpdating { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameJavaProjectProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameJavaProjectProcessor.java index e8b201d351..f82149c7e6 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameJavaProjectProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameJavaProjectProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -52,7 +52,7 @@ import org.eclipse.jdt.internal.corext.util.Resources; import org.eclipse.jdt.ui.refactoring.IRefactoringProcessorIds; import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class RenameJavaProjectProcessor extends JavaRenameProcessor implements IReferenceUpdating { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameLocalVariableProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameLocalVariableProcessor.java index c0a4be1d17..90b01a2968 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameLocalVariableProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameLocalVariableProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -70,7 +70,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class RenameLocalVariableProcessor extends JavaRenameProcessor implements IReferenceUpdating { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameMethodProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameMethodProcessor.java index addc1fb796..9254fc13a8 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameMethodProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameMethodProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -95,7 +95,7 @@ import org.eclipse.jdt.ui.refactoring.IRefactoringProcessorIds; import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public abstract class RenameMethodProcessor extends JavaRenameProcessor implements IReferenceUpdating, IDelegateUpdating { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameNonVirtualMethodProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameNonVirtualMethodProcessor.java index fa049cfad0..e3b67ea1e7 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameNonVirtualMethodProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameNonVirtualMethodProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,7 +43,7 @@ import org.eclipse.jdt.internal.corext.refactoring.structure.CompilationUnitRewr import org.eclipse.jdt.internal.corext.refactoring.util.TextChangeManager; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class RenameNonVirtualMethodProcessor extends RenameMethodProcessor { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenamePackageProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenamePackageProcessor.java index 8381357b09..bdcf75a220 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenamePackageProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenamePackageProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -108,7 +108,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class RenamePackageProcessor extends JavaRenameProcessor implements IReferenceUpdating, ITextUpdating, IQualifiedNameUpdating, IResourceMapper, IJavaElementMapper { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameSourceFolderProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameSourceFolderProcessor.java index 3e52dbc644..0bb4321e7b 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameSourceFolderProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameSourceFolderProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -48,7 +48,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.ui.refactoring.IRefactoringProcessorIds; import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class RenameSourceFolderProcessor extends JavaRenameProcessor { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeParameterProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeParameterProcessor.java index 17f0a34304..ace2f0ac96 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeParameterProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeParameterProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -64,7 +64,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Rename processor to rename type parameters. diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java index 92a59daa3c..aa7f4c945d 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -122,8 +122,8 @@ import org.eclipse.jdt.ui.refactoring.IRefactoringProcessorIds; import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class RenameTypeProcessor extends JavaRenameProcessor implements ITextUpdating, IReferenceUpdating, IQualifiedNameUpdating, ISimilarDeclarationUpdating, IResourceMapper, IJavaElementMapper { @@ -890,7 +890,7 @@ public class RenameTypeProcessor extends JavaRenameProcessor implements ITextUpd private RefactoringStatus analyseEnclosedTypes() throws CoreException { final ISourceRange typeRange= fType.getSourceRange(); final RefactoringStatus result= new RefactoringStatus(); - CompilationUnit cuNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(fType.getCompilationUnit(), false); + CompilationUnit cuNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(fType.getCompilationUnit(), false); cuNode.accept(new ASTVisitor(){ @Override @@ -1345,7 +1345,7 @@ public class RenameTypeProcessor extends JavaRenameProcessor implements ITextUpd final ILocalVariable currentLocal= (ILocalVariable) element; if (currentResolvedCU == null) - currentResolvedCU= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(currentCU, true); + currentResolvedCU= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(currentCU, true); processor= createLocalRenameProcessor(currentLocal, newName, currentResolvedCU); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameVirtualMethodProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameVirtualMethodProcessor.java index 1082e52b01..6249bfdfa1 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameVirtualMethodProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameVirtualMethodProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,7 +40,7 @@ import org.eclipse.jdt.internal.corext.refactoring.util.TextChangeManager; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class RenameVirtualMethodProcessor extends RenameMethodProcessor { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/CreateCopyOfCompilationUnitChange.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/CreateCopyOfCompilationUnitChange.java index 898c9272a0..fc6ecad7c7 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/CreateCopyOfCompilationUnitChange.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/CreateCopyOfCompilationUnitChange.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -52,7 +52,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.SearchUtils; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class CreateCopyOfCompilationUnitChange extends CreateTextFileChange { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/JavaDeleteProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/JavaDeleteProcessor.java index 045009ac20..1a9785216a 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/JavaDeleteProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/JavaDeleteProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -82,7 +82,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.ui.refactoring.IRefactoringProcessorIds; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class JavaDeleteProcessor extends DeleteProcessor { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/MoveCuUpdateCreator.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/MoveCuUpdateCreator.java index 3a03ed549c..6d19392586 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/MoveCuUpdateCreator.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/MoveCuUpdateCreator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -66,7 +66,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.SearchUtils; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class MoveCuUpdateCreator { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/OverwriteHelper.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/OverwriteHelper.java index 3e5319f6c4..3979580f89 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/OverwriteHelper.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/OverwriteHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -33,7 +33,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; class OverwriteHelper { private Object fDestination; diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java index fd16f25e65..a7a0fd9f51 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgPolicyFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -114,6 +114,7 @@ import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRe import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.ASTNodes; +import org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite; import org.eclipse.jdt.internal.corext.refactoring.Checks; import org.eclipse.jdt.internal.corext.refactoring.JDTRefactoringDescriptorComment; import org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments; @@ -145,13 +146,13 @@ import org.eclipse.jdt.internal.corext.util.JavaConventionsUtil; import org.eclipse.jdt.internal.corext.util.JavaElementResourceMapping; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public final class ReorgPolicyFactory { @@ -701,7 +702,7 @@ public final class ReorgPolicyFactory { private CompilationUnit createSourceCuNode() { Assert.isTrue(getSourceCu() != null || getSourceClassFile() != null); Assert.isTrue(getSourceCu() == null || getSourceClassFile() == null); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setBindingsRecovery(true); parser.setResolveBindings(true); if (getSourceCu() != null) @@ -3737,7 +3738,7 @@ public final class ReorgPolicyFactory { } if (getLocation() == IReorgDestination.LOCATION_ON) { - listRewrite.insertAt(newMember, ASTNodes.getInsertionIndex(newMember, listRewrite.getRewrittenList()), null); + listRewrite.insertAt(newMember, BodyDeclarationRewrite.getInsertionIndex(newMember, listRewrite.getRewrittenList()), null); } else { insertRelative(newMember, nodeDestination, listRewrite); } diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgUtils.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgUtils.java index 20d6d77d78..11099f178f 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgUtils.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -53,7 +53,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class ReorgUtils { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/InlineMethodRefactoringContribution.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/InlineMethodRefactoringContribution.java index fca6af49be..39894e24f8 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/InlineMethodRefactoringContribution.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/InlineMethodRefactoringContribution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,7 +39,7 @@ import org.eclipse.jdt.internal.corext.refactoring.code.InlineMethodRefactoring; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * Refactoring contribution for the inline method refactoring. @@ -97,7 +97,7 @@ public final class InlineMethodRefactoringContribution extends JavaUIRefactoring unit= method.getCompilationUnit(); } else throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), 0, Messages.format(RefactoringCoreMessages.InitializableRefactoring_illegal_argument, new Object[] { handle, JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT}), null)); - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setResolveBindings(true); parser.setSource(unit); node= (CompilationUnit) parser.createAST(null); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/RenameMethodRefactoringContribution.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/RenameMethodRefactoringContribution.java index f63643e71e..a18ae1fdd8 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/RenameMethodRefactoringContribution.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/scripting/RenameMethodRefactoringContribution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -32,7 +32,7 @@ import org.eclipse.jdt.internal.corext.refactoring.rename.RenameNonVirtualMethod import org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Refactoring contribution for the rename method refactoring. diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/sef/SelfEncapsulateFieldRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/sef/SelfEncapsulateFieldRefactoring.java index 7046a80a32..31e9bafd19 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/sef/SelfEncapsulateFieldRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/sef/SelfEncapsulateFieldRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -112,8 +112,8 @@ import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; /** @@ -240,7 +240,7 @@ public class SelfEncapsulateFieldRefactoring extends Refactoring { result.merge(Checks.checkAvailability(fField)); if (result.hasFatalError()) return result; - fRoot= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(fField.getCompilationUnit(), true, pm); + fRoot= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(fField.getCompilationUnit(), true, pm); ISourceRange sourceRange= fField.getNameRange(); ASTNode node= NodeFinder.perform(fRoot, sourceRange.getOffset(), sourceRange.getLength()); if (node == null) { @@ -381,7 +381,7 @@ public class SelfEncapsulateFieldRefactoring extends Refactoring { importRewrite= fImportRewrite; descriptions= ownerDescriptions; } else { - root= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(unit, true); + root= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(unit, true); rewriter= ASTRewrite.create(root.getAST()); descriptions= new ArrayList<>(); importRewrite= StubUtility.createImportRewrite(root, true); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java index be1164acb2..75b652292d 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeSignatureProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -162,8 +162,8 @@ import org.eclipse.jdt.internal.corext.util.SearchUtils; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class ChangeSignatureProcessor extends RefactoringProcessor implements IDelegateUpdating { @@ -668,7 +668,7 @@ public class ChangeSignatureProcessor extends RefactoringProcessor implements ID int offset= cuBuff.length(); cuBuff.append(trimmed) .append(CONST_CLOSE); - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setSource(cuBuff.toString().toCharArray()); CompilationUnit cu= (CompilationUnit) p.createAST(null); Selection selection= Selection.createFromStartLength(offset, trimmed.length()); @@ -688,7 +688,7 @@ public class ChangeSignatureProcessor extends RefactoringProcessor implements ID int offset= cuBuff.length(); cuBuff.append(trimmed) .append(");}}"); //$NON-NLS-1$ - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setSource(cuBuff.toString().toCharArray()); CompilationUnit cu= (CompilationUnit) p.createAST(null); Selection selection= Selection.createFromStartLength(offset, trimmed.length()); @@ -1010,7 +1010,7 @@ public class ChangeSignatureProcessor extends RefactoringProcessor implements ID ICompilationUnit cu= getCu(); TextChange change= fChangeManager.get(cu); String newCuSource= change.getPreviewContent(new NullProgressMonitor()); - CompilationUnit newCUNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(newCuSource, cu, true, false, null); + CompilationUnit newCUNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(newCuSource, cu, true, false, null); IProblem[] problems= RefactoringAnalyzeUtil.getIntroducedCompileProblems(newCUNode, fBaseCuRewrite.getRoot()); RefactoringStatus result= new RefactoringStatus(); for (int i= 0; i < problems.length; i++) { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeTypeRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeTypeRefactoring.java index 1d292d5411..51b014f131 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeTypeRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ChangeTypeRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -115,8 +115,8 @@ import org.eclipse.jdt.internal.corext.util.SearchUtils; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; /** @@ -537,7 +537,7 @@ public class ChangeTypeRefactoring extends Refactoring { * @throws CoreException */ private void addAllChangesFor(ICompilationUnit icu, Set<ConstraintVariable> vars, CompilationUnitChange unitChange) throws CoreException { - CompilationUnit unit= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(icu, true); + CompilationUnit unit= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(icu, true); ASTRewrite unitRewriter= ASTRewrite.create(unit.getAST()); MultiTextEdit root= new MultiTextEdit(); unitChange.setEdit(root); // Adam sez don't need this, but then unitChange.addGroupDescription() fails an assertion! diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/CompilationUnitRewrite.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/CompilationUnitRewrite.java index dfc1c6c96b..8ecfb9bdab 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/CompilationUnitRewrite.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/CompilationUnitRewrite.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -42,7 +42,7 @@ import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * A {@link CompilationUnitRewrite} holds all data structures that are typically @@ -320,7 +320,7 @@ public class CompilationUnitRewrite { public CompilationUnit getRoot() { if (fRoot == null) - fRoot= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(fCu, fOwner, fResolveBindings, fStatementsRecovery, fBindingsRecovery, null); + fRoot= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(fCu, fOwner, fResolveBindings, fStatementsRecovery, fBindingsRecovery, null); return fRoot; } diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ConstructorReferenceFinder.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ConstructorReferenceFinder.java index 9255eadac3..70c4cd5b90 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ConstructorReferenceFinder.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ConstructorReferenceFinder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -54,7 +54,7 @@ import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.corext.util.SearchUtils; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * This class is used to find references to constructors. @@ -105,7 +105,7 @@ class ConstructorReferenceFinder { ICompilationUnit cu= group.getCompilationUnit(); if (cu == null) continue; - CompilationUnit cuNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(cu, false); + CompilationUnit cuNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(cu, false); SearchMatch[] allSearchResults= group.getSearchResults(); List<SearchMatch> realConstructorReferences= new ArrayList<>(Arrays.asList(allSearchResults)); for (int j= 0; j < allSearchResults.length; j++) { @@ -189,7 +189,7 @@ class ConstructorReferenceFinder { ICompilationUnit cu= group.getCompilationUnit(); if (cu == null) continue; - CompilationUnit cuNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(cu, false); + CompilationUnit cuNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(cu, false); SearchMatch[] results= group.getSearchResults(); for (int j= 0; j < results.length; j++) { SearchMatch searchResult= results[j]; @@ -246,7 +246,7 @@ class ConstructorReferenceFinder { //Collection of SearchResults private static Collection<SearchMatch> getAllSuperConstructorInvocations(IType type) throws JavaModelException { IMethod[] constructors= JavaElementUtil.getAllConstructors(type); - CompilationUnit cuNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(type.getCompilationUnit(), false); + CompilationUnit cuNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(type.getCompilationUnit(), false); List<SearchMatch> result= new ArrayList<>(constructors.length); for (int i= 0; i < constructors.length; i++) { ASTNode superCall= getSuperConstructorCallNode(constructors[i], cuNode); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractClassRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractClassRefactoring.java index e888b0dc12..4d373cfc8b 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractClassRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractClassRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -103,8 +103,9 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class ExtractClassRefactoring extends Refactoring { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractInterfaceProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractInterfaceProcessor.java index 8f1abf884f..ce107ba958 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractInterfaceProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractInterfaceProcessor.java @@ -91,11 +91,14 @@ import org.eclipse.jdt.core.refactoring.IJavaRefactorings; import org.eclipse.jdt.core.refactoring.descriptors.ExtractInterfaceDescriptor; import org.eclipse.jdt.core.refactoring.descriptors.JavaRefactoringDescriptor; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatureDescriptorFactory; import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2; import org.eclipse.jdt.internal.corext.dom.Bindings; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.corext.dom.ModifierRewrite; import org.eclipse.jdt.internal.corext.refactoring.Checks; import org.eclipse.jdt.internal.corext.refactoring.JDTRefactoringDescriptorComment; @@ -120,16 +123,12 @@ import org.eclipse.jdt.internal.corext.refactoring.util.TextEditBasedChangeManag import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; - /** * Refactoring processor to extract interfaces. @@ -1062,7 +1061,7 @@ public final class ExtractInterfaceProcessor extends SuperTypeRefactoringProcess } JavaModelUtil.reconcile(subUnit); final IJavaProject project= subUnit.getJavaProject(); - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setWorkingCopyOwner(fOwner); parser.setResolveBindings(true); parser.setProject(project); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractSupertypeProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractSupertypeProcessor.java index e11f45580c..31e6ccfe69 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractSupertypeProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractSupertypeProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -105,10 +105,9 @@ import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; - +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Refactoring processor for the extract supertype refactoring. @@ -796,7 +795,7 @@ public final class ExtractSupertypeProcessor extends PullUpRefactoringProcessor collection.add(current); } final ITypeBinding[] extractBindings= { null}; - final ASTParser extractParser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser extractParser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); extractParser.setWorkingCopyOwner(fOwner); extractParser.setResolveBindings(true); extractParser.setProject(project); @@ -807,7 +806,7 @@ public final class ExtractSupertypeProcessor extends PullUpRefactoringProcessor if (extractDeclaration != null) extractBindings[0]= extractDeclaration.resolveBinding(); } - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); final IProgressMonitor subMonitor= new SubProgressMonitor(monitor, 30); try { final Set<IJavaProject> keySet= projectToUnits.keySet(); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/HierarchyProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/HierarchyProcessor.java index bce9b42af2..a783640450 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/HierarchyProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/HierarchyProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -99,7 +99,7 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.SearchUtils; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaElementLabels; diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/IntroduceParameterObjectProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/IntroduceParameterObjectProcessor.java index fd3088fb0b..43bde33c8f 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/IntroduceParameterObjectProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/IntroduceParameterObjectProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -89,8 +89,9 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class IntroduceParameterObjectProcessor extends ChangeSignatureProcessor { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberCheckUtil.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberCheckUtil.java index 7bd5a8e3b2..e9ba3174d2 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberCheckUtil.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MemberCheckUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,7 +30,7 @@ import org.eclipse.jdt.internal.corext.refactoring.base.JavaStatusContext; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; class MemberCheckUtil { diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java index 0e40574e47..5245a7f69f 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInnerToTopRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -129,15 +129,15 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.SearchUtils; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; @@ -611,7 +611,7 @@ public final class MoveInnerToTopRefactoring extends Refactoring { fTypeImports= null; fStaticImports= null; TextEdit edits= rewrite.rewriteImports(new SubProgressMonitor(monitor, 1)); - JavaModelUtil.applyEdit(targetUnit, edits, false, new SubProgressMonitor(monitor, 1)); + JavaElementUtil.applyEdit(targetUnit, edits, false, new SubProgressMonitor(monitor, 1)); } finally { monitor.done(); } @@ -689,7 +689,7 @@ public final class MoveInnerToTopRefactoring extends Refactoring { private RefactoringStatus checkConstructorParameterNames() { RefactoringStatus result= new RefactoringStatus(); - CompilationUnit cuNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(fType.getCompilationUnit(), false); + CompilationUnit cuNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(fType.getCompilationUnit(), false); MethodDeclaration[] nodes= getConstructorDeclarationNodes(findTypeDeclaration(fType, cuNode)); for (int i= 0; i < nodes.length; i++) { MethodDeclaration constructor= nodes[i]; @@ -1049,7 +1049,7 @@ public final class MoveInnerToTopRefactoring extends Refactoring { if (change == null) change= new CompilationUnitChange("", unit); //$NON-NLS-1$ final String source= change.getPreviewContent(new NullProgressMonitor()); - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(fType.getJavaProject()); parser.setResolveBindings(false); parser.setSource(source.toCharArray()); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java index 7417f1771d..8ec34815d1 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java @@ -126,6 +126,7 @@ import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; +import org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite; import org.eclipse.jdt.internal.corext.dom.ModifierRewrite; import org.eclipse.jdt.internal.corext.dom.ScopeAnalyzer; import org.eclipse.jdt.internal.corext.refactoring.Checks; @@ -151,13 +152,13 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.SearchUtils; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; @@ -2634,7 +2635,7 @@ public final class MoveInstanceMethodProcessor extends MoveProcessor implements final CompilationUnitRewrite rewriter= getCompilationUnitRewrite(rewrites, getTargetType().getCompilationUnit()); final MethodDeclaration stub= (MethodDeclaration) rewriter.getASTRewrite().createStringPlaceholder(createMethodContent(document, declaration, rewrite), ASTNode.METHOD_DECLARATION); final AbstractTypeDeclaration type= ASTNodeSearchUtil.getAbstractTypeDeclarationNode(getTargetType(), rewriter.getRoot()); - rewriter.getASTRewrite().getListRewrite(type, type.getBodyDeclarationsProperty()).insertAt(stub, ASTNodes.getInsertionIndex(stub, type.bodyDeclarations()), rewriter.createGroupDescription(RefactoringCoreMessages.MoveInstanceMethodProcessor_add_moved_method)); + rewriter.getASTRewrite().getListRewrite(type, type.getBodyDeclarationsProperty()).insertAt(stub, BodyDeclarationRewrite.getInsertionIndex(stub, type.bodyDeclarations()), rewriter.createGroupDescription(RefactoringCoreMessages.MoveInstanceMethodProcessor_add_moved_method)); } catch (BadLocationException exception) { JavaPlugin.log(exception); } diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveStaticMembersProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveStaticMembersProcessor.java index 18c851c70b..ba1a72a0a6 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveStaticMembersProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveStaticMembersProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -97,6 +97,7 @@ import org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatur import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.corext.dom.ASTNodes; +import org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite; import org.eclipse.jdt.internal.corext.dom.ModifierRewrite; import org.eclipse.jdt.internal.corext.refactoring.Checks; import org.eclipse.jdt.internal.corext.refactoring.CollectingSearchRequestor; @@ -122,14 +123,14 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.SearchUtils; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.ui.refactoring.IRefactoringProcessorIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public final class MoveStaticMembersProcessor extends MoveProcessor implements IDelegateUpdating { @@ -1066,7 +1067,7 @@ public final class MoveStaticMembersProcessor extends MoveProcessor implements I ASTNode node= fTarget.getASTRewrite().createStringPlaceholder(sources[i], declaration.getNodeType()); List<BodyDeclaration> container= containerRewrite.getRewrittenList(); - int insertionIndex= ASTNodes.getInsertionIndex((BodyDeclaration) node, container); + int insertionIndex= BodyDeclarationRewrite.getInsertionIndex((BodyDeclaration) node, container); containerRewrite.insertAt(node, insertionIndex, add); } return result; diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java index d1a5d173e2..a66647bdf2 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PullUpRefactoringProcessor.java @@ -107,6 +107,7 @@ import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; +import org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite; import org.eclipse.jdt.internal.corext.dom.ModifierRewrite; import org.eclipse.jdt.internal.corext.refactoring.Checks; import org.eclipse.jdt.internal.corext.refactoring.JDTRefactoringDescriptorComment; @@ -131,15 +132,15 @@ import org.eclipse.jdt.internal.corext.refactoring.util.TextEditBasedChangeManag import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Refactoring processor for the pull up refactoring. @@ -536,7 +537,7 @@ public class PullUpRefactoringProcessor extends HierarchyProcessor { CodeGenerationSettings codeGenerationSettings= JavaPreferencesSettings.getCodeGenerationSettings(javaProject); StubUtility2.addOverrideAnnotation(codeGenerationSettings, javaProject, astRewrite, importRewrite, newMethod, getDeclaringType().isInterface(), rewriter.createCategorizedGroupDescription(RefactoringCoreMessages.PullUpRefactoring_add_override_annotation, SET_PULL_UP)); - astRewrite.getListRewrite(typeToCreateStubIn, typeToCreateStubIn.getBodyDeclarationsProperty()).insertAt(newMethod, ASTNodes.getInsertionIndex(newMethod, typeToCreateStubIn.bodyDeclarations()), rewriter.createCategorizedGroupDescription(RefactoringCoreMessages.PullUpRefactoring_add_method_stub, SET_PULL_UP)); + astRewrite.getListRewrite(typeToCreateStubIn, typeToCreateStubIn.getBodyDeclarationsProperty()).insertAt(newMethod, BodyDeclarationRewrite.getInsertionIndex(newMethod, typeToCreateStubIn.bodyDeclarations()), rewriter.createCategorizedGroupDescription(RefactoringCoreMessages.PullUpRefactoring_add_method_stub, SET_PULL_UP)); } private void addNecessaryMethodStubs(final List<IType> affected, final CompilationUnit root, final CompilationUnitRewrite unitRewriter, final Map<IMember, IncomingMemberVisibilityAdjustment> adjustments, final IProgressMonitor monitor, final RefactoringStatus status) throws CoreException { @@ -1052,7 +1053,7 @@ public class PullUpRefactoringProcessor extends HierarchyProcessor { copyTypeParameters(oldMethod, newMethod); ImportRewriteContext context= new ContextSensitiveImportRewriteContext(destination, targetRewrite.getImportRewrite()); ImportRewriteUtil.addImports(targetRewrite, context, oldMethod, new HashMap<Name, String>(), new HashMap<Name, String>(), true); - targetRewrite.getASTRewrite().getListRewrite(destination, destination.getBodyDeclarationsProperty()).insertAt(newMethod, ASTNodes.getInsertionIndex(newMethod, destination.bodyDeclarations()), targetRewrite.createCategorizedGroupDescription(RefactoringCoreMessages.PullUpRefactoring_add_abstract_method, SET_PULL_UP)); + targetRewrite.getASTRewrite().getListRewrite(destination, destination.getBodyDeclarationsProperty()).insertAt(newMethod, org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite.getInsertionIndex(newMethod, destination.bodyDeclarations()), targetRewrite.createCategorizedGroupDescription(RefactoringCoreMessages.PullUpRefactoring_add_abstract_method, SET_PULL_UP)); } @Override @@ -1167,7 +1168,7 @@ public class PullUpRefactoringProcessor extends HierarchyProcessor { if (oldField != null) { int flags= getModifiersWithUpdatedVisibility(member, member.getFlags(), adjustments, new SubProgressMonitor(subsub, 1), true, status); final FieldDeclaration newField= createNewFieldDeclarationNode(rewriter, root, (IField) member, oldField, mapping, new SubProgressMonitor(subsub, 1), status, flags); - rewriter.getListRewrite(declaration, declaration.getBodyDeclarationsProperty()).insertAt(newField, ASTNodes.getInsertionIndex(newField, declaration.bodyDeclarations()), rewrite.createCategorizedGroupDescription(RefactoringCoreMessages.HierarchyRefactoring_add_member, SET_PULL_UP)); + rewriter.getListRewrite(declaration, declaration.getBodyDeclarationsProperty()).insertAt(newField, org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite.getInsertionIndex(newField, declaration.bodyDeclarations()), rewrite.createCategorizedGroupDescription(RefactoringCoreMessages.HierarchyRefactoring_add_member, SET_PULL_UP)); ImportRewriteUtil.addImports(rewrite, context, oldField.getParent(), new HashMap<Name, String>(), new HashMap<Name, String>(), false); } } else if (member instanceof IMethod) { @@ -1176,14 +1177,14 @@ public class PullUpRefactoringProcessor extends HierarchyProcessor { if (JdtFlags.isStatic(member) && fDestinationType.isInterface()) status.merge(RefactoringStatus.createErrorStatus(Messages.format(RefactoringCoreMessages.PullUpRefactoring_moving_static_method_to_interface, new String[] { JavaElementLabels.getTextLabel(member, JavaElementLabels.ALL_FULLY_QUALIFIED)}), JavaStatusContext.create(member))); final MethodDeclaration newMethod= createNewMethodDeclarationNode(sourceRewriter, rewrite, ((IMethod) member), oldMethod, mapping, adjustments, new SubProgressMonitor(subsub, 1), status); - rewriter.getListRewrite(declaration, declaration.getBodyDeclarationsProperty()).insertAt(newMethod, ASTNodes.getInsertionIndex(newMethod, declaration.bodyDeclarations()), rewrite.createCategorizedGroupDescription(RefactoringCoreMessages.HierarchyRefactoring_add_member, SET_PULL_UP)); + rewriter.getListRewrite(declaration, declaration.getBodyDeclarationsProperty()).insertAt(newMethod, org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite.getInsertionIndex(newMethod, declaration.bodyDeclarations()), rewrite.createCategorizedGroupDescription(RefactoringCoreMessages.HierarchyRefactoring_add_member, SET_PULL_UP)); ImportRewriteUtil.addImports(rewrite, context, oldMethod, new HashMap<Name, String>(), new HashMap<Name, String>(), newMethod.getBody() == null); } } else if (member instanceof IType) { final AbstractTypeDeclaration oldType= ASTNodeSearchUtil.getAbstractTypeDeclarationNode((IType) member, root); if (oldType != null) { final BodyDeclaration newType= createNewTypeDeclarationNode(((IType) member), oldType, root, mapping, rewriter); - rewriter.getListRewrite(declaration, declaration.getBodyDeclarationsProperty()).insertAt(newType, ASTNodes.getInsertionIndex(newType, declaration.bodyDeclarations()), rewrite.createCategorizedGroupDescription(RefactoringCoreMessages.HierarchyRefactoring_add_member, SET_PULL_UP)); + rewriter.getListRewrite(declaration, declaration.getBodyDeclarationsProperty()).insertAt(newType, org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite.getInsertionIndex(newType, declaration.bodyDeclarations()), rewrite.createCategorizedGroupDescription(RefactoringCoreMessages.HierarchyRefactoring_add_member, SET_PULL_UP)); ImportRewriteUtil.addImports(rewrite, context, oldType, new HashMap<Name, String>(), new HashMap<Name, String>(), false); } } else @@ -1904,7 +1905,7 @@ public class PullUpRefactoringProcessor extends HierarchyProcessor { monitor.setTaskName(RefactoringCoreMessages.PullUpRefactoring_checking); final IType declaring= getDeclaringType(); final IJavaProject project= declaring.getJavaProject(); - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setWorkingCopyOwner(fOwner); parser.setResolveBindings(true); parser.setProject(project); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PushDownRefactoringProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PushDownRefactoringProcessor.java index 5619a2010f..ee74d762eb 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PushDownRefactoringProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/PushDownRefactoringProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -79,7 +79,7 @@ import org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatur import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; -import org.eclipse.jdt.internal.corext.dom.ASTNodes; +import org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite; import org.eclipse.jdt.internal.corext.dom.ModifierRewrite; import org.eclipse.jdt.internal.corext.refactoring.Checks; import org.eclipse.jdt.internal.corext.refactoring.JDTRefactoringDescriptorComment; @@ -99,13 +99,13 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.SearchUtils; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** @@ -643,14 +643,14 @@ public final class PushDownRefactoringProcessor extends HierarchyProcessor { final VariableDeclarationFragment oldField= ASTNodeSearchUtil.getFieldDeclarationFragmentNode((IField) infos[offset].getMember(), sourceRewriter.getRoot()); if (oldField != null) { FieldDeclaration newField= createNewFieldDeclarationNode(infos[offset], sourceRewriter.getRoot(), mapping, unitRewriter.getASTRewrite(), oldField); - unitRewriter.getASTRewrite().getListRewrite(declaration, declaration.getBodyDeclarationsProperty()).insertAt(newField, ASTNodes.getInsertionIndex(newField, declaration.bodyDeclarations()), unitRewriter.createCategorizedGroupDescription(RefactoringCoreMessages.HierarchyRefactoring_add_member, SET_PUSH_DOWN)); + unitRewriter.getASTRewrite().getListRewrite(declaration, declaration.getBodyDeclarationsProperty()).insertAt(newField, BodyDeclarationRewrite.getInsertionIndex(newField, declaration.bodyDeclarations()), unitRewriter.createCategorizedGroupDescription(RefactoringCoreMessages.HierarchyRefactoring_add_member, SET_PUSH_DOWN)); ImportRewriteUtil.addImports(unitRewriter, context, oldField.getParent(), new HashMap<Name, String>(), new HashMap<Name, String>(), false); } } else { final MethodDeclaration oldMethod= ASTNodeSearchUtil.getMethodDeclarationNode((IMethod) infos[offset].getMember(), sourceRewriter.getRoot()); if (oldMethod != null) { MethodDeclaration newMethod= createNewMethodDeclarationNode(infos[offset], mapping, unitRewriter, oldMethod); - unitRewriter.getASTRewrite().getListRewrite(declaration, declaration.getBodyDeclarationsProperty()).insertAt(newMethod, ASTNodes.getInsertionIndex(newMethod, declaration.bodyDeclarations()), unitRewriter.createCategorizedGroupDescription(RefactoringCoreMessages.HierarchyRefactoring_add_member, SET_PUSH_DOWN)); + unitRewriter.getASTRewrite().getListRewrite(declaration, declaration.getBodyDeclarationsProperty()).insertAt(newMethod, BodyDeclarationRewrite.getInsertionIndex(newMethod, declaration.bodyDeclarations()), unitRewriter.createCategorizedGroupDescription(RefactoringCoreMessages.HierarchyRefactoring_add_member, SET_PUSH_DOWN)); ImportRewriteUtil.addImports(unitRewriter, context, oldMethod, new HashMap<Name, String>(), new HashMap<Name, String>(), false); } } diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/UseSuperTypeProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/UseSuperTypeProcessor.java index a7934b7c1f..9761789cc0 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/UseSuperTypeProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/UseSuperTypeProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -69,8 +69,8 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** @@ -271,7 +271,7 @@ public final class UseSuperTypeProcessor extends SuperTypeRefactoringProcessor { monitor.setTaskName(RefactoringCoreMessages.UseSuperTypeProcessor_creating); final TextEditBasedChangeManager manager= new TextEditBasedChangeManager(); final IJavaProject project= fSubType.getJavaProject(); - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setWorkingCopyOwner(fOwner); parser.setResolveBindings(true); parser.setProject(project); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java index 748d3f6cf3..9fb71be7f6 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/constraints/SuperTypeRefactoringProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -113,7 +113,7 @@ import org.eclipse.jdt.internal.corext.util.SearchUtils; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; /** * Partial implementation of a refactoring processor solving supertype @@ -284,7 +284,7 @@ public abstract class SuperTypeRefactoringProcessor extends RefactoringProcessor buffer.append(delimiter); buffer.append('}'); final IDocument document= new Document(buffer.toString()); - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(document.get().toCharArray()); final CompilationUnit unit= (CompilationUnit) parser.createAST(new SubProgressMonitor(monitor, 100)); final ASTRewrite targetRewrite= ASTRewrite.create(unit.getAST()); @@ -1019,7 +1019,7 @@ public abstract class SuperTypeRefactoringProcessor extends RefactoringProcessor } collection.add(current); } - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); final IProgressMonitor subMonitor= new SubProgressMonitor(monitor, 320); try { final Set<IJavaProject> keySet= projects.keySet(); @@ -1138,7 +1138,7 @@ public abstract class SuperTypeRefactoringProcessor extends RefactoringProcessor IJavaProject project= null; Collection<SearchResultGroup> collection= null; try { - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); Object element= null; ICompilationUnit current= null; SearchResultGroup group= null; diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithAnalyzer.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithAnalyzer.java index d28dc148ae..24d7395568 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithAnalyzer.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithAnalyzer.java @@ -1,5 +1,6 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 IBM Corporation and others. + + * Copyright (c) 2005, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -31,14 +32,13 @@ import org.eclipse.jdt.core.dom.Statement; import org.eclipse.jdt.core.dom.SuperConstructorInvocation; import org.eclipse.jdt.core.dom.VariableDeclaration; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Selection; import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.refactoring.base.JavaStatusContext; import org.eclipse.jdt.internal.corext.refactoring.util.CodeAnalyzer; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; - public class SurroundWithAnalyzer extends CodeAnalyzer { private VariableDeclaration[] fLocals; diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithTryCatchRefactoring.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithTryCatchRefactoring.java index d38a91715c..45c68311af 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithTryCatchRefactoring.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/surround/SurroundWithTryCatchRefactoring.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -72,10 +72,11 @@ import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; import org.eclipse.jdt.internal.corext.refactoring.util.SelectionAwareSourceRangeComputer; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; + +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.QuickAssistProcessor; /** @@ -176,7 +177,7 @@ public class SurroundWithTryCatchRefactoring extends Refactoring { */ @Override public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException { - CompilationUnit rootNode= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(fCUnit, true, pm); + CompilationUnit rootNode= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(fCUnit, true, pm); return checkActivationBasics(rootNode); } diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/ASTCreator.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/ASTCreator.java index aec473195e..51a2226cbe 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/ASTCreator.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/ASTCreator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -18,8 +18,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; - +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class ASTCreator { @@ -36,7 +35,7 @@ public class ASTCreator { } private static CompilationUnit getCuNode(WorkingCopyOwner workingCopyOwner, ICompilationUnit cu) { - ASTParser p = ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p = ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setSource(cu); p.setResolveBindings(true); p.setWorkingCopyOwner(workingCopyOwner); diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/JavaElementUtil.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/JavaElementUtil.java index 242b164ccd..632fd04532 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/JavaElementUtil.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/JavaElementUtil.java @@ -18,9 +18,16 @@ import java.util.List; import java.util.Set; import org.eclipse.core.runtime.Assert; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.text.edits.TextEdit; + import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IField; @@ -37,11 +44,14 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.core.SourceRange; +import org.eclipse.jdt.internal.corext.CorextMessages; +import org.eclipse.jdt.internal.corext.ValidateEditException; import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; +import org.eclipse.jdt.internal.corext.util.Resources; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** @@ -256,4 +266,28 @@ public class JavaElementUtil { return false; } } + + /** + * Applies an text edit to a compilation unit. Filed bug 117694 against jdt.core. + * @param cu the compilation unit to apply the edit to + * @param edit the edit to apply + * @param save is set, save the CU after the edit has been applied + * @param monitor the progress monitor to use + * @throws CoreException Thrown when the access to the CU failed + * @throws ValidateEditException if validate edit fails + */ + public static void applyEdit(ICompilationUnit cu, TextEdit edit, boolean save, IProgressMonitor monitor) throws CoreException, ValidateEditException { + SubMonitor subMonitor= SubMonitor.convert(monitor, CorextMessages.JavaModelUtil_applyedit_operation, 2); + IFile file= (IFile) cu.getResource(); + if (!save || !file.exists()) { + cu.applyTextEdit(edit, subMonitor.split(2)); + } else { + IStatus status= Resources.makeCommittable(file, null); + if (!status.isOK()) { + throw new ValidateEditException(status); + } + cu.applyTextEdit(edit, subMonitor.split(1)); + cu.save(subMonitor.split(1), true); + } + } } diff --git a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/RefactoringASTParser.java b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/RefactoringASTParser.java index 3463d596d0..15c289aaac 100644 --- a/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/RefactoringASTParser.java +++ b/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/util/RefactoringASTParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,7 +30,7 @@ import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.ui.SharedASTProvider; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class RefactoringASTParser { @@ -120,7 +120,7 @@ public class RefactoringASTParser { if (cuNode != null) { return cuNode; } else { - return new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(typeRoot, null, resolveBindings, ASTProvider.SHARED_AST_STATEMENT_RECOVERY, ASTProvider.SHARED_BINDING_RECOVERY, pm); + return new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(typeRoot, null, resolveBindings, IASTSharedValues.SHARED_AST_STATEMENT_RECOVERY, IASTSharedValues.SHARED_BINDING_RECOVERY, pm); } } diff --git a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java index d9aac8aa20..ac2300062f 100644 --- a/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java +++ b/org.eclipse.jdt.ui/internal compatibility/org/eclipse/jdt/internal/ui/dialogs/TypeInfoViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -72,7 +72,7 @@ import org.eclipse.jdt.core.search.TypeNameRequestor; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.OpenTypeHistory; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.corext.util.TypeFilter; import org.eclipse.jdt.internal.corext.util.TypeInfoFilter; import org.eclipse.jdt.internal.corext.util.TypeInfoRequestorAdapter; diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ChangeExceptionsControl.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ChangeExceptionsControl.java index 74f894dcb5..06e5044d7b 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ChangeExceptionsControl.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ChangeExceptionsControl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -60,7 +60,7 @@ import org.eclipse.jdt.internal.ui.JavaUIStatus; import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * A special control to add and remove thrown exceptions. diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ChangeTypeWizard.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ChangeTypeWizard.java index e7f1f36e5a..e33e8f7bc1 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ChangeTypeWizard.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ChangeTypeWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -52,7 +52,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/InlineTempWizard.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/InlineTempWizard.java index 66ff38d431..56578053b2 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/InlineTempWizard.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/InlineTempWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,7 +20,7 @@ import org.eclipse.jdt.internal.corext.refactoring.code.InlineTempRefactoring; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class InlineTempWizard extends RefactoringWizard { diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/IntroduceParameterObjectWizard.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/IntroduceParameterObjectWizard.java index 404c90167c..e5723d4df0 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/IntroduceParameterObjectWizard.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/IntroduceParameterObjectWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -80,7 +80,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class IntroduceParameterObjectWizard extends RefactoringWizard { diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/MoveInstanceMethodWizard.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/MoveInstanceMethodWizard.java index 2e2ec259c9..e4a59de7c3 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/MoveInstanceMethodWizard.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/MoveInstanceMethodWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -57,7 +57,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.dialogs.TextFieldNavigationHandler; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; /** diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/MoveMembersWizard.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/MoveMembersWizard.java index e22d458ea7..060a7ae3a9 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/MoveMembersWizard.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/MoveMembersWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -64,7 +64,7 @@ import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssis import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class MoveMembersWizard extends RefactoringWizard { diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ParameterEditDialog.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ParameterEditDialog.java index 5bbf9bd50f..227816ad56 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ParameterEditDialog.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ParameterEditDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -44,7 +44,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.TextFieldNavigationHandler; import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper; import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class ParameterEditDialog extends StatusDialog { diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PullUpMethodPage.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PullUpMethodPage.java index 58c8230981..ad587c0d97 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PullUpMethodPage.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PullUpMethodPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 IBM Corporation and others. + * Copyright (c) 2006, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -71,7 +71,7 @@ import org.eclipse.jdt.internal.corext.refactoring.RefactoringCoreMessages; import org.eclipse.jdt.internal.corext.refactoring.structure.PullUpRefactoringProcessor; import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaElementComparator; import org.eclipse.jdt.ui.JavaElementLabelProvider; diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/code/ExtractMethodInputPage.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/code/ExtractMethodInputPage.java index d11fda4434..791e097936 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/code/ExtractMethodInputPage.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/code/ExtractMethodInputPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -60,7 +60,7 @@ import org.eclipse.jdt.internal.ui.refactoring.InputPageUtil; import org.eclipse.jdt.internal.ui.refactoring.RefactoringMessages; import org.eclipse.jdt.internal.ui.util.RowLayouter; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class ExtractMethodInputPage extends UserInputWizardPage { diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/AccessorDescription.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/AccessorDescription.java index 93cd1ab666..41fc357667 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/AccessorDescription.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/AccessorDescription.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,7 +20,7 @@ import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/ExternalizeWizard.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/ExternalizeWizard.java index 3c4e98a23b..9250d62eb8 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/ExternalizeWizard.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/ExternalizeWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -33,7 +33,7 @@ import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.actions.ActionMessages; import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * good citizen problems - wizard is only valid after constructor (when the pages toggle diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/ExternalizeWizardPage.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/ExternalizeWizardPage.java index 5aef73869f..79a3012be1 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/ExternalizeWizardPage.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/ExternalizeWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -111,7 +111,7 @@ import org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer; import org.eclipse.jdt.internal.ui.propertiesfileeditor.PropertiesFileEscapes; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener; diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchQuery.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchQuery.java index 5ad90c2f63..2ea643c4bb 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchQuery.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchQuery.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -45,7 +45,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIStatus; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class NLSSearchQuery implements ISearchQuery { diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchResultLabelProvider2.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchResultLabelProvider2.java index d6c8a98fc4..129cd373a0 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchResultLabelProvider2.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/nls/search/NLSSearchResultLabelProvider2.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,7 +24,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.search.TextSearchLabelProvider; import org.eclipse.jdt.internal.ui.viewsupport.AppearanceAwareLabelProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; class NLSSearchResultLabelProvider2 extends TextSearchLabelProvider implements IStyledLabelProvider { diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/NewNameQueries.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/NewNameQueries.java index 72bdbc67d2..6dc8a44ee2 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/NewNameQueries.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/NewNameQueries.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -46,7 +46,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.TextFieldNavigationHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class NewNameQueries implements INewNameQueries { diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/PasteAction.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/PasteAction.java index 9317e5a196..1e156c363e 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/PasteAction.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/PasteAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -124,7 +124,7 @@ import org.eclipse.jdt.core.dom.rewrite.ListRewrite; import org.eclipse.jdt.core.refactoring.CompilationUnitChange; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; -import org.eclipse.jdt.internal.corext.dom.ASTNodes; +import org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite; import org.eclipse.jdt.internal.corext.refactoring.Checks; import org.eclipse.jdt.internal.corext.refactoring.TypedSource; import org.eclipse.jdt.internal.corext.refactoring.changes.TextChangeCompatibility; @@ -140,7 +140,7 @@ import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.launching.IVMInstall; import org.eclipse.jdt.launching.IVMInstall2; @@ -159,14 +159,14 @@ import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.IJavaStatusConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIMessages; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper; import org.eclipse.jdt.internal.ui.refactoring.RefactoringMessages; import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.SelectionUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock; import org.eclipse.jdt.internal.ui.workingsets.IWorkingSetIDs; @@ -365,7 +365,7 @@ public class PasteAction extends SelectionDispatchAction{ private final String fPackageName; public static List<ParsedCu> parseCus(IJavaProject javaProject, String compilerCompliance, String text) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); if (javaProject != null) { parser.setProject(javaProject); } else if (compilerCompliance != null) { @@ -810,7 +810,7 @@ public class PasteAction extends SelectionDispatchAction{ try { IDocument document= fileBuffer.getDocument(); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(cu.getJavaProject()); parser.setSource(document.get().toCharArray()); parser.setStatementsRecovery(true); @@ -837,7 +837,7 @@ public class PasteAction extends SelectionDispatchAction{ cuContent= ""; //$NON-NLS-1$ IDocument document= new Document(cuContent); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(cu.getJavaProject()); parser.setSource(cuContent.toCharArray()); parser.setStatementsRecovery(true); @@ -1525,7 +1525,7 @@ public class PasteAction extends SelectionDispatchAction{ @Override public Change createChange(IProgressMonitor pm) throws CoreException { - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setSource(getDestinationCu()); CompilationUnit cuNode= (CompilationUnit) p.createAST(pm); ASTRewrite rewrite= ASTRewrite.create(cuNode.getAST()); @@ -1561,7 +1561,7 @@ public class PasteAction extends SelectionDispatchAction{ case ASTNode.METHOD_DECLARATION: case ASTNode.FIELD_DECLARATION: case ASTNode.INITIALIZER: - rewrite.getListRewrite(typeDeclaration, typeDeclaration.getBodyDeclarationsProperty()).insertAt(node, ASTNodes.getInsertionIndex((BodyDeclaration) node, typeDeclaration.bodyDeclarations()), null); + rewrite.getListRewrite(typeDeclaration, typeDeclaration.getBodyDeclarationsProperty()).insertAt(node, BodyDeclarationRewrite.getInsertionIndex((BodyDeclaration) node, typeDeclaration.bodyDeclarations()), null); break; default: Assert.isTrue(false, String.valueOf(node.getNodeType())); @@ -1573,7 +1573,7 @@ public class PasteAction extends SelectionDispatchAction{ case ASTNode.TYPE_DECLARATION: case ASTNode.ENUM_DECLARATION: case ASTNode.ANNOTATION_TYPE_DECLARATION: - rewrite.getListRewrite(cuNode, CompilationUnit.TYPES_PROPERTY).insertAt(node, ASTNodes.getInsertionIndex((AbstractTypeDeclaration) node, cuNode.types()), null); + rewrite.getListRewrite(cuNode, CompilationUnit.TYPES_PROPERTY).insertAt(node, BodyDeclarationRewrite.getInsertionIndex((AbstractTypeDeclaration) node, cuNode.types()), null); break; case ASTNode.IMPORT_DECLARATION: rewrite.getListRewrite(cuNode, CompilationUnit.IMPORTS_PROPERTY).insertLast(node, null); diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/RenameFieldWizard.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/RenameFieldWizard.java index 735c14fd0f..b543d1b370 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/RenameFieldWizard.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/RenameFieldWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -37,7 +37,7 @@ import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.refactoring.RefactoringMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class RenameFieldWizard extends RenameRefactoringWizard { diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgMoveWizard.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgMoveWizard.java index 13443e3572..b84ca63e07 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgMoveWizard.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgMoveWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -47,7 +47,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.refactoring.QualifiedNameComponent; import org.eclipse.jdt.internal.ui.refactoring.RefactoringMessages; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class ReorgMoveWizard extends RefactoringWizard { diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgUserInputPage.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgUserInputPage.java index a4ac0d9d03..fa6b821372 100644 --- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgUserInputPage.java +++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/reorg/ReorgUserInputPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -47,7 +47,7 @@ import org.eclipse.jdt.ui.JavaElementLabelProvider; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; abstract class ReorgUserInputPage extends UserInputWizardPage{ diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionUtil.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionUtil.java index f46197e076..51cb729f87 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionUtil.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/ActionUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -38,7 +38,7 @@ import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /* * http://dev.eclipse.org/bugs/show_bug.cgi?id=19104 diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/CleanUpAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/CleanUpAction.java index 347576ce86..92b45dee62 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/CleanUpAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/CleanUpAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -50,7 +50,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.browsing.LogicalPackage; import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; import org.eclipse.jdt.internal.ui.util.ElementValidator; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.workingsets.IWorkingSetIDs; public abstract class CleanUpAction extends SelectionDispatchAction { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/ExpandWithConstructorsConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/ExpandWithConstructorsConfigurationBlock.java index ea775c5c70..00430ea2b3 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/ExpandWithConstructorsConfigurationBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/ExpandWithConstructorsConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 IBM Corporation and others. + * Copyright (c) 2009, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -57,7 +57,7 @@ import org.eclipse.jdt.internal.ui.dialogs.TextFieldNavigationHandler; import org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock; import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/FocusOnSelectionAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/FocusOnSelectionAction.java index aeebf9b667..a05bed9373 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/FocusOnSelectionAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/FocusOnSelectionAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,7 +27,7 @@ import org.eclipse.jdt.internal.corext.callhierarchy.MethodWrapper; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; class FocusOnSelectionAction extends Action { private CallHierarchyViewPart fPart; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistoryImpl.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistoryImpl.java index fa5245ef28..630fc31798 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistoryImpl.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistoryImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -62,6 +62,7 @@ import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; import org.eclipse.jdt.internal.corext.dom.ASTNodes; +import org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite; import org.eclipse.jdt.internal.corext.util.Resources; import org.eclipse.jdt.ui.IWorkingCopyManager; @@ -190,19 +191,19 @@ class JavaAddElementFromHistoryImpl extends JavaHistoryActionImpl { if (parent instanceof ICompilationUnit) { // top level ListRewrite lw= rewriter.getListRewrite(root, CompilationUnit.TYPES_PROPERTY); - int index= ASTNodes.getInsertionIndex((BodyDeclaration)newNode, root.types()); + int index= BodyDeclarationRewrite.getInsertionIndex((BodyDeclaration)newNode, root.types()); lw.insertAt(newNode, index, null); } else if (parent instanceof IType) { ASTNode declaration= getBodyContainer(root, (IType)parent); if (declaration instanceof TypeDeclaration || declaration instanceof AnnotationTypeDeclaration) { List<BodyDeclaration> container= ASTNodes.getBodyDeclarations(declaration); - int index= ASTNodes.getInsertionIndex((BodyDeclaration)newNode, container); + int index= BodyDeclarationRewrite.getInsertionIndex((BodyDeclaration)newNode, container); ListRewrite lw= rewriter.getListRewrite(declaration, ASTNodes.getBodyDeclarationsProperty(declaration)); lw.insertAt(newNode, index, null); } else if (declaration instanceof EnumDeclaration) { List<EnumConstantDeclaration> container= ((EnumDeclaration)declaration).enumConstants(); - int index= ASTNodes.getInsertionIndex((FieldDeclaration)newNode, container); + int index= BodyDeclarationRewrite.getInsertionIndex((FieldDeclaration)newNode, container); ListRewrite lw= rewriter.getListRewrite(declaration, EnumDeclaration.ENUM_CONSTANTS_PROPERTY); lw.insertAt(newNode, index, null); } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaHistoryActionImpl.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaHistoryActionImpl.java index 6e131fe3e3..2859db9b76 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaHistoryActionImpl.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaHistoryActionImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -66,11 +66,11 @@ import org.eclipse.jdt.core.dom.NodeFinder; import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.SelectionConverter; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; /** @@ -334,7 +334,7 @@ abstract class JavaHistoryActionImpl /* extends Action implements IActionDelegat throw new IllegalArgumentException(); } try { - ASTParser c= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser c= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); c.setSource(unit); c.setFocalPosition(0); c.setResolveBindings(false); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaStructureCreator.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaStructureCreator.java index f0a50a4539..94c4ca0db4 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaStructureCreator.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaStructureCreator.java @@ -58,10 +58,11 @@ import org.eclipse.jdt.core.compiler.InvalidInputException; import org.eclipse.jdt.core.dom.ASTParser; import org.eclipse.jdt.core.dom.CompilationUnit; + import org.eclipse.jdt.ui.text.IJavaPartitions; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; public class JavaStructureCreator extends StructureCreator { @@ -275,7 +276,7 @@ public class JavaStructureCreator extends StructureCreator { contents.getChars(0, n, buffer, 0); } - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); if (compilerOptions != null) parser.setCompilerOptions(compilerOptions); parser.setSource(buffer); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java index 864acbd6ec..4ae0d6f4a0 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/FilteredTypesSelectionDialog.java @@ -116,7 +116,7 @@ import org.eclipse.jdt.internal.ui.preferences.TypeFilterPreferencePage; import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.TypeNameMatchLabelProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.workingsets.WorkingSetFilterActionGroup; @@ -1263,9 +1263,11 @@ public class FilteredTypesSelectionDialog extends FilteredItemsSelectionDialog i int result= leftString.compareToIgnoreCase(rightString); if (result != 0 || rightString.length() == 0) { return result; - } else if (Strings.isLowerCase(leftString.charAt(0)) && !Strings.isLowerCase(rightString.charAt(0))) { + } else if (org.eclipse.jdt.internal.core.manipulation.util.Strings.isLowerCase(leftString.charAt(0)) + && !org.eclipse.jdt.internal.core.manipulation.util.Strings.isLowerCase(rightString.charAt(0))) { return +1; - } else if (Strings.isLowerCase(rightString.charAt(0)) && !Strings.isLowerCase(leftString.charAt(0))) { + } else if (org.eclipse.jdt.internal.core.manipulation.util.Strings.isLowerCase(rightString.charAt(0)) + && !org.eclipse.jdt.internal.core.manipulation.util.Strings.isLowerCase(leftString.charAt(0))) { return -1; } else { return leftString.compareTo(rightString); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OverrideMethodDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OverrideMethodDialog.java index fcc1d70034..07c2eeb98d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OverrideMethodDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/dialogs/OverrideMethodDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -58,7 +58,7 @@ import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.JavaUIMessages; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor; import org.eclipse.jdt.internal.ui.util.ViewerPane; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; @@ -292,7 +292,7 @@ public class OverrideMethodDialog extends SourceActionDialog { public OverrideMethodDialog(Shell shell, CompilationUnitEditor editor, IType type, boolean isSubType) throws JavaModelException { super(shell, new BindingLabelProvider(), new OverrideMethodContentProvider(), editor, type, false); - RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); + RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); fUnit= parser.parse(type.getCompilationUnit(), true); final ITypeBinding binding= ASTNodes.getTypeBinding(fUnit, type); List<IMethodBinding> toImplement= new ArrayList<>(); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/SortMembersCleanUp.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/SortMembersCleanUp.java index 4009aabdce..507905a29a 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/SortMembersCleanUp.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/fix/SortMembersCleanUp.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,7 +39,7 @@ import org.eclipse.jdt.ui.cleanup.CleanUpContext; import org.eclipse.jdt.ui.cleanup.CleanUpRequirements; import org.eclipse.jdt.ui.cleanup.ICleanUpFix; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class SortMembersCleanUp extends AbstractCleanUp { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/infoviews/JavadocView.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/infoviews/JavadocView.java index 10203639f0..1ae9521bab 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/infoviews/JavadocView.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/infoviews/JavadocView.java @@ -144,12 +144,12 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.actions.ActionMessages; import org.eclipse.jdt.internal.ui.actions.SimpleSelectionProvider; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; import org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover; import org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.FallbackInformationPresenter; import org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLinkedLabelComposer; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLinks; @@ -1337,7 +1337,7 @@ public class JavadocView extends AbstractInfoView { if (monitor != null && monitor.isCanceled()) return null; - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setProject(constantField.getJavaProject()); IBinding[] createBindings; try { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/infoviews/SourceView.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/infoviews/SourceView.java index e853d14fc9..8588b1d01d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/infoviews/SourceView.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/infoviews/SourceView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -55,7 +55,7 @@ import org.eclipse.jdt.core.ISourceReference; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.IContextMenuConstants; import org.eclipse.jdt.ui.actions.IJavaEditorActionDefinitionIds; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CreateJarActionDelegate.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CreateJarActionDelegate.java index 308cee7df0..cffe7b4127 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CreateJarActionDelegate.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CreateJarActionDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -37,7 +37,7 @@ import org.eclipse.jdt.ui.jarpackager.JarPackageData; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class CreateJarActionDelegate extends JarPackageActionDelegate { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java index 7ec1bb30d4..03d9b10695 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -88,7 +88,7 @@ import org.eclipse.jdt.ui.refactoring.RefactoringSaveHelper; import org.eclipse.jdt.internal.ui.IJavaStatusConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Operation for exporting a resource and its children to a new JAR file. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackagerUtil.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackagerUtil.java index ddfac5a27d..bbe3cb79ea 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackagerUtil.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackagerUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -56,7 +56,7 @@ import org.eclipse.jdt.ui.jarpackager.JarPackageData; import org.eclipse.jdt.internal.ui.IJavaStatusConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Utility methods for JAR Import/Export. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarAntExporter.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarAntExporter.java index 504fd62b17..5b2a4f0714 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarAntExporter.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarAntExporter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -46,7 +46,7 @@ import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Create an ANT script for a runnable JAR. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizardPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizardPage.java index 9a3df6eba7..1a662d9e0f 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizardPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -89,7 +89,7 @@ import org.eclipse.jdt.internal.ui.jarpackager.JarPackagerUtil; import org.eclipse.jdt.internal.ui.search.JavaSearchScopeFactory; import org.eclipse.jdt.internal.ui.util.MainMethodSearchEngine; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackagerUtil.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackagerUtil.java index da967eea96..5504b31c09 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackagerUtil.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackagerUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,7 +25,7 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Utility methods for Runnable JAR Import/Export. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/JarWriter4.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/JarWriter4.java index 44b180647f..efc1e4f63f 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/JarWriter4.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/JarWriter4.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -35,7 +35,7 @@ import org.eclipse.jdt.ui.jarpackager.JarWriter3; import org.eclipse.jdt.internal.ui.jarpackager.JarPackagerMessages; import org.eclipse.jdt.internal.ui.jarpackager.JarPackagerUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/UnpackFatJarBuilder.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/UnpackFatJarBuilder.java index 6da4231ad6..59a3ae6806 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/UnpackFatJarBuilder.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackagerfat/UnpackFatJarBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,7 +25,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.jarpackager.IManifestProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * A jar builder wich unpacks all referenced libraries into the generated jar. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocLinkDialogLabelProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocLinkDialogLabelProvider.java index d422d4b432..3739486e4c 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocLinkDialogLabelProvider.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocLinkDialogLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,7 +27,7 @@ import org.eclipse.jdt.ui.JavaElementImageDescriptor; import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocOptionsManager.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocOptionsManager.java index 4796f1ee22..25bd2dd7f7 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocOptionsManager.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocOptionsManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -69,7 +69,7 @@ import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIStatus; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class JavadocOptionsManager { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocWizard.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocWizard.java index 4c3cbf8f9b..ea447c742b 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocWizard.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javadocexport/JavadocWizard.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -86,7 +86,7 @@ import org.eclipse.jdt.internal.ui.actions.OpenBrowserUtil; import org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog; import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class JavadocWizard extends Wizard implements IExportWizard { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ASTProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ASTProvider.java index c55bc2c637..2ceda6b38c 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ASTProvider.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ASTProvider.java @@ -29,13 +29,13 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.ITypeRoot; import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.dom.AST; import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.ASTParser; import org.eclipse.jdt.core.dom.AbstractTypeDeclaration; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.internal.corext.dom.ASTNodes; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.ui.SharedASTProvider; @@ -50,7 +50,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; * * @since 3.0 */ -public final class ASTProvider { +public final class ASTProvider implements IASTSharedValues { /** * @deprecated Use {@link SharedASTProvider#WAIT_YES} instead. @@ -208,13 +208,8 @@ public final class ASTProvider { } } - public static final int SHARED_AST_LEVEL= AST.JLS8; - public static final boolean SHARED_AST_STATEMENT_RECOVERY= true; - public static final boolean SHARED_BINDING_RECOVERY= true; - private static final String DEBUG_PREFIX= "ASTProvider > "; //$NON-NLS-1$ - private volatile ITypeRoot fReconcilingJavaElement; private ITypeRoot fActiveJavaElement; private CompilationUnit fAST; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java index ff8fd5d5b1..cc52d5d19f 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -100,7 +100,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIStatus; import org.eclipse.jdt.internal.ui.actions.CompositeActionGroup; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.buildpaths.SourceAttachmentBlock; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClipboardOperationAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClipboardOperationAction.java index c5672a4503..6d13092b3a 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClipboardOperationAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClipboardOperationAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -77,6 +77,7 @@ import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; import org.eclipse.jdt.internal.corext.codemanipulation.ImportReferencesCollector; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.Bindings; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.ui.JavaUI; @@ -554,7 +555,7 @@ public final class ClipboardOperationAction extends TextEditorAction { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { - JavaModelUtil.applyEdit(unit, rewrite.rewriteImports(monitor), false, null); + JavaElementUtil.applyEdit(unit, rewrite.rewriteImports(monitor), false, null); } catch (CoreException e) { throw new InvocationTargetException(e); } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JarEntryEditorInput.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JarEntryEditorInput.java index 4c2022578f..2df2dc2224 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JarEntryEditorInput.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JarEntryEditorInput.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -29,7 +29,7 @@ import org.eclipse.jdt.core.IJarEntryResource; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.internal.ui.JarEntryEditorInputFactory; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * An EditorInput for a JarEntryFile. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java index 3bc7589c31..8217749717 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java @@ -218,11 +218,11 @@ import org.eclipse.jdt.internal.ui.javaeditor.selectionactions.StructureSelectPr import org.eclipse.jdt.internal.ui.javaeditor.selectionactions.StructureSelectionAction; import org.eclipse.jdt.internal.ui.search.BreakContinueTargetFinder; import org.eclipse.jdt.internal.ui.search.ExceptionOccurrencesFinder; -import org.eclipse.jdt.internal.ui.search.IOccurrencesFinder; -import org.eclipse.jdt.internal.ui.search.IOccurrencesFinder.OccurrenceLocation; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder.OccurrenceLocation; import org.eclipse.jdt.internal.ui.search.ImplementOccurrencesFinder; import org.eclipse.jdt.internal.ui.search.MethodExitsFinder; -import org.eclipse.jdt.internal.ui.search.OccurrencesFinder; +import org.eclipse.jdt.internal.core.manipulation.search.OccurrencesFinder; import org.eclipse.jdt.internal.ui.text.DocumentCharacterIterator; import org.eclipse.jdt.internal.ui.text.JavaChangeHover; import org.eclipse.jdt.internal.ui.text.JavaPairMatcher; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementHyperlinkDetector.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementHyperlinkDetector.java index 089a35dc2f..579068bf99 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementHyperlinkDetector.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementHyperlinkDetector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -45,7 +45,7 @@ import org.eclipse.jdt.ui.SharedASTProvider; import org.eclipse.jdt.ui.actions.SelectionDispatchAction; import org.eclipse.jdt.internal.ui.search.BreakContinueTargetFinder; -import org.eclipse.jdt.internal.ui.search.IOccurrencesFinder.OccurrenceLocation; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder.OccurrenceLocation; import org.eclipse.jdt.internal.ui.text.JavaWordFinder; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/NLSKeyHyperlink.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/NLSKeyHyperlink.java index 5d5bfb92ca..c88bf5e0d4 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/NLSKeyHyperlink.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/NLSKeyHyperlink.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -53,7 +53,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.propertiesfileeditor.IPropertiesFilePartitions; import org.eclipse.jdt.internal.ui.propertiesfileeditor.PropertyKeyHyperlinkDetector; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/OverrideIndicatorManager.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/OverrideIndicatorManager.java index 4b74c685f2..4f765e8b3f 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/OverrideIndicatorManager.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/OverrideIndicatorManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -49,7 +49,7 @@ import org.eclipse.jdt.ui.SharedASTProvider; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.text.java.IJavaReconcilingListener; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Manages the override and overwrite indicators for diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/navigator/JavaNavigatorLabelProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/navigator/JavaNavigatorLabelProvider.java index 5df01f599d..1b97bb7b5e 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/navigator/JavaNavigatorLabelProvider.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/navigator/JavaNavigatorLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -35,7 +35,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.navigator.IExtensionStateConstants.Values; import org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider; import org.eclipse.jdt.internal.ui.packageview.PackageExplorerLabelProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Provides the labels for the Project Explorer. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/ClassPathContainer.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/ClassPathContainer.java index 8902bdbb72..0e43de1a18 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/ClassPathContainer.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/ClassPathContainer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,7 +39,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Representation of class path containers in Java UI. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDragAdapter.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDragAdapter.java index 4e867b0807..cbeb9cb11c 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDragAdapter.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/FileTransferDragAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -51,7 +51,7 @@ import org.eclipse.jdt.internal.corext.util.Resources; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Drag support class to allow dragging of files and folder from diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java index f90c636d1e..f8cc14ee18 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java @@ -728,7 +728,7 @@ public class PackageExplorerPart extends ViewPart if (path.isRoot()) { result= PackagesMessages.PackageExplorer_title; } else { - result= BasicElementLabels.getPathLabel(path, false); + result= org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels.getPathLabel(path, false); } } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeAssistFavoritesConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeAssistFavoritesConfigurationBlock.java index e0dc803d40..8292d9ada4 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeAssistFavoritesConfigurationBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeAssistFavoritesConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -58,7 +58,7 @@ import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.dialogs.TextFieldNavigationHandler; import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeTemplateBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeTemplateBlock.java index ec6d7ee4cc..5e7784b147 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeTemplateBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CodeTemplateBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -69,7 +69,7 @@ import org.eclipse.jdt.ui.text.JavaTextTools; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer; import org.eclipse.jdt.internal.ui.text.template.preferences.TemplateVariableProcessor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.ProjectTemplateStore; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ComplianceConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ComplianceConfigurationBlock.java index 7776ac5c60..bb98d0479e 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ComplianceConfigurationBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ComplianceConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -60,7 +60,7 @@ import org.eclipse.jdt.launching.environments.IExecutionEnvironment; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport; import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizeConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizeConfigurationBlock.java index 3e4df5a2a2..5e974506ab 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizeConfigurationBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ImportOrganizeConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -48,7 +48,7 @@ import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationBlock.java index 3276c80fe1..aa9d28d273 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -73,7 +73,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.OpenBrowserUtil; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.dialogs.StatusUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.FilteredElementTreeSelectionDialog; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationPropertyPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationPropertyPage.java index c4cb18543e..fca729e875 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationPropertyPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavadocConfigurationPropertyPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -60,7 +60,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.StatusUtil; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.buildpaths.ArchiveFileFilter; import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NameConventionConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NameConventionConfigurationBlock.java index c4e768a0b4..3ba5855476 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NameConventionConfigurationBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NameConventionConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -44,7 +44,7 @@ import org.eclipse.jdt.core.JavaConventions; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaElementImageDescriptor; import org.eclipse.jdt.ui.PreferenceConstants; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NativeLibrariesConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NativeLibrariesConfigurationBlock.java index 05ca7cbc0b..7e770bd0e8 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NativeLibrariesConfigurationBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NativeLibrariesConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -46,7 +46,7 @@ import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NativeLibrariesPropertyPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NativeLibrariesPropertyPage.java index 8d7d51aea9..c7c8ec413a 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NativeLibrariesPropertyPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/NativeLibrariesPropertyPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -57,7 +57,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.StatusUtil; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.buildpaths.ArchiveFileFilter; import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java index 0f94a976a4..799c4e6f12 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/ProblemSeveritiesConfigurationBlock.java @@ -85,7 +85,7 @@ import org.eclipse.jdt.internal.ui.refactoring.contentassist.CompletionContextRe import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper; import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter; import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/SourceAttachmentPropertyPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/SourceAttachmentPropertyPage.java index 79151d9051..4a223c42c7 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/SourceAttachmentPropertyPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/SourceAttachmentPropertyPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -53,7 +53,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.StatusUtil; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.buildpaths.SourceAttachmentBlock; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ModifyDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ModifyDialog.java index 514977e34a..eee534423a 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ModifyDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ModifyDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -57,7 +57,7 @@ import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.preferences.formatter.ProfileManager.CustomProfile; import org.eclipse.jdt.internal.ui.preferences.formatter.ProfileManager.Profile; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener; import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ProfileConfigurationBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ProfileConfigurationBlock.java index d4bba8b42f..6eb203e0e7 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ProfileConfigurationBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/formatter/ProfileConfigurationBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -61,7 +61,7 @@ import org.eclipse.jdt.internal.ui.preferences.formatter.ProfileManager.CustomPr import org.eclipse.jdt.internal.ui.preferences.formatter.ProfileManager.Profile; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public abstract class ProfileConfigurationBlock { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertiesQuickAssistProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertiesQuickAssistProcessor.java index c0257c3d42..b168fd5612 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertiesQuickAssistProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertiesQuickAssistProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2012 IBM Corporation and others. + * Copyright (c) 2011, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -58,7 +58,7 @@ import org.eclipse.jdt.ui.text.java.correction.ChangeCorrectionProposal; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.text.correction.proposals.EditAnnotator; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * The properties file quick assist processor. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlink.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlink.java index b9bbd7adf2..86a46bb1be 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlink.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlink.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -85,7 +85,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.PatternConstructor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/BreakContinueTargetFinder.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/BreakContinueTargetFinder.java index 72aea35619..2bfb00487f 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/BreakContinueTargetFinder.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/BreakContinueTargetFinder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -32,11 +32,12 @@ import org.eclipse.jdt.core.dom.SimpleName; import org.eclipse.jdt.core.dom.SwitchStatement; import org.eclipse.jdt.core.dom.WhileStatement; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.TokenScanner; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/ExceptionOccurrencesFinder.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/ExceptionOccurrencesFinder.java index 1d1eb56fb4..36fa6ced5b 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/ExceptionOccurrencesFinder.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/ExceptionOccurrencesFinder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -44,12 +44,12 @@ import org.eclipse.jdt.core.dom.UnionType; import org.eclipse.jdt.core.dom.VariableDeclarationExpression; import org.eclipse.jdt.core.dom.VariableDeclarationFragment; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.util.Messages; - -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class ExceptionOccurrencesFinder extends ASTVisitor implements IOccurrencesFinder { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/FindOccurrencesEngine.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/FindOccurrencesEngine.java index 34a95a69d6..e57e3cd3dc 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/FindOccurrencesEngine.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/FindOccurrencesEngine.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -16,6 +16,8 @@ import org.eclipse.jdt.core.ITypeRoot; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder; + import org.eclipse.jdt.ui.SharedASTProvider; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/ImplementOccurrencesFinder.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/ImplementOccurrencesFinder.java index e125ef324b..6f32879f3b 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/ImplementOccurrencesFinder.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/ImplementOccurrencesFinder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,11 +30,12 @@ import org.eclipse.jdt.core.dom.Type; import org.eclipse.jdt.core.dom.TypeDeclaration; import org.eclipse.jdt.core.dom.TypeDeclarationStatement; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementLine.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementLine.java index a62121789e..11188f45a8 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementLine.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaElementLine.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -22,7 +22,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaUI; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class JavaElementLine { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchQuery.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchQuery.java index dc38fa6590..308a93e339 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchQuery.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchQuery.java @@ -51,7 +51,7 @@ import org.eclipse.jdt.ui.search.QuerySpecification; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class JavaSearchQuery implements ISearchQuery { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchScopeFactory.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchScopeFactory.java index 96303846b5..3edc1c7ca3 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchScopeFactory.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchScopeFactory.java @@ -205,22 +205,22 @@ public class JavaSearchScopeFactory { String scopeDescription; if (projectNames.length == 1) { String label= includeJRE ? SearchMessages.EnclosingProjectScope : SearchMessages.EnclosingProjectScopeNoJRE; - scopeDescription= Messages.format(label, BasicElementLabels.getJavaElementName(projectNames[0])); + scopeDescription= Messages.format(label, org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels.getJavaElementName(projectNames[0])); } else if (projectNames.length == 2) { String label= includeJRE ? SearchMessages.EnclosingProjectsScope2 : SearchMessages.EnclosingProjectsScope2NoJRE; - scopeDescription= Messages.format(label, new String[] { BasicElementLabels.getJavaElementName(projectNames[0]), BasicElementLabels.getJavaElementName(projectNames[1])}); + scopeDescription= Messages.format(label, new String[] { org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels.getJavaElementName(projectNames[0]), org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels.getJavaElementName(projectNames[1])}); } else { String label= includeJRE ? SearchMessages.EnclosingProjectsScope : SearchMessages.EnclosingProjectsScopeNoJRE; - scopeDescription= Messages.format(label, new String[] { BasicElementLabels.getJavaElementName(projectNames[0]), BasicElementLabels.getJavaElementName(projectNames[1])}); + scopeDescription= Messages.format(label, new String[] { org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels.getJavaElementName(projectNames[0]), org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels.getJavaElementName(projectNames[1])}); } return scopeDescription; } public String getProjectScopeDescription(IJavaProject project, boolean includeJRE) { if (includeJRE) { - return Messages.format(SearchMessages.ProjectScope, BasicElementLabels.getJavaElementName(project.getElementName())); + return Messages.format(SearchMessages.ProjectScope, org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels.getJavaElementName(project.getElementName())); } else { - return Messages.format(SearchMessages.ProjectScopeNoJRE, BasicElementLabels.getJavaElementName(project.getElementName())); + return Messages.format(SearchMessages.ProjectScopeNoJRE, org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels.getJavaElementName(project.getElementName())); } } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/MethodExitsFinder.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/MethodExitsFinder.java index 32df3d55be..ff9f80cb96 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/MethodExitsFinder.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/MethodExitsFinder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -42,6 +42,8 @@ import org.eclipse.jdt.core.dom.UnionType; import org.eclipse.jdt.core.dom.VariableDeclarationExpression; import org.eclipse.jdt.core.dom.VariableDeclarationFragment; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.dom.LocalVariableIndex; @@ -49,9 +51,7 @@ import org.eclipse.jdt.internal.corext.refactoring.code.flow.FlowContext; import org.eclipse.jdt.internal.corext.refactoring.code.flow.FlowInfo; import org.eclipse.jdt.internal.corext.refactoring.code.flow.InOutFlowAnalyzer; import org.eclipse.jdt.internal.corext.util.Messages; - -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class MethodExitsFinder extends ASTVisitor implements IOccurrencesFinder { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchLabelProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchLabelProvider.java index adce40ac8c..cb47467933 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchLabelProvider.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,11 +19,13 @@ import org.eclipse.jface.viewers.StyledString.Styler; import org.eclipse.search.ui.text.AbstractTextSearchViewPage; import org.eclipse.search.ui.text.Match; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.viewsupport.ColoringLabelProvider; +import org.eclipse.jdt.internal.core.manipulation.search.SearchMessages; class OccurrencesSearchLabelProvider extends TextSearchLabelProvider implements IStyledLabelProvider { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchQuery.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchQuery.java index 10915ea363..d4049192fb 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchQuery.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchQuery.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,8 +30,9 @@ import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.search.IOccurrencesFinder.OccurrenceLocation; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder.OccurrenceLocation; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class OccurrencesSearchQuery implements ISearchQuery { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchResultPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchResultPage.java index 3c7621b2b5..d5b70d4bfd 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchResultPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/OccurrencesSearchResultPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -48,6 +48,9 @@ import org.eclipse.jdt.core.ITypeRoot; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder; +import org.eclipse.jdt.internal.core.manipulation.search.OccurrencesFinder; + import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.ui.SharedASTProvider; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchMessages.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchMessages.java index d97520389c..e86abdbde2 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchMessages.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchMessages.java @@ -131,14 +131,6 @@ public final class SearchMessages extends NLS { public static String Search_FindOccurrencesInFile_tooltip; public static String FindOccurrencesEngine_noSource_text; public static String FindOccurrencesEngine_cannotParse_text; - public static String OccurrencesFinder_no_element; - public static String OccurrencesFinder_no_binding; - public static String OccurrencesFinder_searchfor; - public static String OccurrencesFinder_label_singular; - public static String OccurrencesFinder_label_plural; - public static String OccurrencesFinder_occurrence_description; - public static String OccurrencesFinder_occurrence_write_description; - public static String OccurrencesSearchLabelProvider_line_number; public static String ExceptionOccurrencesFinder_no_exception; public static String ExceptionOccurrencesFinder_searchfor; public static String ExceptionOccurrencesFinder_label_singular; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchMessages.properties b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchMessages.properties index b8a5bde6a2..1ed3fc1457 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchMessages.properties +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchMessages.properties @@ -135,17 +135,6 @@ Search_FindOccurrencesInFile_tooltip= Find Occurrences of the Selected Element i FindOccurrencesEngine_noSource_text= No source available. To perform this operation you need to attach source. FindOccurrencesEngine_cannotParse_text= Cannot analyze the compilation unit or class file. -OccurrencesFinder_no_element= Cannot search for the current selection. Please select a valid Java element name. -OccurrencesFinder_no_binding= Selected Java element is unknown. -OccurrencesFinder_searchfor=Search for Occurrences in File -# The first argument will be replaced by the element name and the second one by the file name -OccurrencesFinder_label_singular=''{0}'' - 1 occurrence in ''{1}'' -# The first argument will be replaced by the element name, the second by the count and the last by the file name -OccurrencesFinder_label_plural=''{0}'' - {1} occurrences in ''{2}'' -OccurrencesFinder_occurrence_description=Occurrence of ''{0}'' -OccurrencesFinder_occurrence_write_description=Write occurrence of ''{0}'' -OccurrencesSearchLabelProvider_line_number={0}: - ExceptionOccurrencesFinder_no_exception= Cannot search for current selection. Please select an exception. ExceptionOccurrencesFinder_searchfor= Search for Exception Occurrences diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java index b94978b256..23c3bed9bf 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java @@ -11,91 +11,31 @@ package org.eclipse.jdt.internal.ui.text.correction; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; - -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.dom.AST; import org.eclipse.jdt.core.dom.ASTNode; -import org.eclipse.jdt.core.dom.ASTParser; -import org.eclipse.jdt.core.dom.AbstractTypeDeclaration; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.AnonymousClassDeclaration; import org.eclipse.jdt.core.dom.ArrayAccess; -import org.eclipse.jdt.core.dom.ArrayCreation; -import org.eclipse.jdt.core.dom.ArrayInitializer; -import org.eclipse.jdt.core.dom.ArrayType; -import org.eclipse.jdt.core.dom.AssertStatement; -import org.eclipse.jdt.core.dom.Assignment; -import org.eclipse.jdt.core.dom.BodyDeclaration; -import org.eclipse.jdt.core.dom.CastExpression; import org.eclipse.jdt.core.dom.ClassInstanceCreation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.ConditionalExpression; -import org.eclipse.jdt.core.dom.ConstructorInvocation; -import org.eclipse.jdt.core.dom.Expression; import org.eclipse.jdt.core.dom.FieldAccess; -import org.eclipse.jdt.core.dom.FieldDeclaration; -import org.eclipse.jdt.core.dom.IBinding; import org.eclipse.jdt.core.dom.IMethodBinding; import org.eclipse.jdt.core.dom.ITypeBinding; -import org.eclipse.jdt.core.dom.IVariableBinding; -import org.eclipse.jdt.core.dom.InfixExpression; -import org.eclipse.jdt.core.dom.Initializer; -import org.eclipse.jdt.core.dom.InstanceofExpression; -import org.eclipse.jdt.core.dom.LambdaExpression; -import org.eclipse.jdt.core.dom.MemberValuePair; import org.eclipse.jdt.core.dom.MethodDeclaration; -import org.eclipse.jdt.core.dom.MethodInvocation; -import org.eclipse.jdt.core.dom.Modifier; -import org.eclipse.jdt.core.dom.Name; import org.eclipse.jdt.core.dom.NameQualifiedType; import org.eclipse.jdt.core.dom.ParameterizedType; -import org.eclipse.jdt.core.dom.PrefixExpression; -import org.eclipse.jdt.core.dom.PrimitiveType; -import org.eclipse.jdt.core.dom.PrimitiveType.Code; import org.eclipse.jdt.core.dom.QualifiedName; import org.eclipse.jdt.core.dom.QualifiedType; -import org.eclipse.jdt.core.dom.SimpleName; -import org.eclipse.jdt.core.dom.SimpleType; -import org.eclipse.jdt.core.dom.SingleVariableDeclaration; -import org.eclipse.jdt.core.dom.Statement; -import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor; -import org.eclipse.jdt.core.dom.SuperConstructorInvocation; -import org.eclipse.jdt.core.dom.SuperMethodInvocation; -import org.eclipse.jdt.core.dom.SwitchCase; -import org.eclipse.jdt.core.dom.SwitchStatement; -import org.eclipse.jdt.core.dom.TagElement; -import org.eclipse.jdt.core.dom.TryStatement; import org.eclipse.jdt.core.dom.Type; import org.eclipse.jdt.core.dom.TypeDeclaration; -import org.eclipse.jdt.core.dom.TypeLiteral; import org.eclipse.jdt.core.dom.TypeParameter; import org.eclipse.jdt.core.dom.VariableDeclaration; -import org.eclipse.jdt.core.dom.VariableDeclarationExpression; import org.eclipse.jdt.core.dom.VariableDeclarationFragment; -import org.eclipse.jdt.core.dom.VariableDeclarationStatement; import org.eclipse.jdt.core.dom.WildcardType; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; -import org.eclipse.jdt.internal.corext.dom.ASTNodes; -import org.eclipse.jdt.internal.corext.dom.Bindings; -import org.eclipse.jdt.internal.corext.dom.GenericVisitor; -import org.eclipse.jdt.internal.corext.dom.ScopeAnalyzer; -import org.eclipse.jdt.internal.corext.dom.TypeBindingVisitor; import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; -import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.ui.JavaElementLabels; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; /** @@ -103,238 +43,39 @@ import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; * * @see JDTUIHelperClasses */ -public class ASTResolving { - - public static ITypeBinding guessBindingForReference(ASTNode node) { - return Bindings.normalizeTypeBinding(getPossibleReferenceBinding(node)); +public class ASTResolving extends org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving { + public static String getMethodSignature(IMethodBinding binding) { + return BindingLabelProvider.getBindingLabel(binding, BindingLabelProvider.DEFAULT_TEXTFLAGS); } - private static ITypeBinding getPossibleReferenceBinding(ASTNode node) { - ASTNode parent= node.getParent(); - switch (parent.getNodeType()) { - case ASTNode.ASSIGNMENT: - Assignment assignment= (Assignment) parent; - if (node.equals(assignment.getLeftHandSide())) { - // field write access: xx= expression - return assignment.getRightHandSide().resolveTypeBinding(); - } - // read access - return assignment.getLeftHandSide().resolveTypeBinding(); - case ASTNode.INFIX_EXPRESSION: - InfixExpression infix= (InfixExpression) parent; - InfixExpression.Operator op= infix.getOperator(); - if (op == InfixExpression.Operator.CONDITIONAL_AND || op == InfixExpression.Operator.CONDITIONAL_OR) { - // boolean operation - return infix.getAST().resolveWellKnownType("boolean"); //$NON-NLS-1$ - } else if (op == InfixExpression.Operator.LEFT_SHIFT || op == InfixExpression.Operator.RIGHT_SHIFT_UNSIGNED || op == InfixExpression.Operator.RIGHT_SHIFT_SIGNED) { - // asymmetric operation - return infix.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ - } - if (node.equals(infix.getLeftOperand())) { - // xx operation expression - ITypeBinding rigthHandBinding= infix.getRightOperand().resolveTypeBinding(); - if (rigthHandBinding != null) { - return rigthHandBinding; - } - } else { - // expression operation xx - ITypeBinding leftHandBinding= infix.getLeftOperand().resolveTypeBinding(); - if (leftHandBinding != null) { - return leftHandBinding; - } - } - if (op != InfixExpression.Operator.EQUALS && op != InfixExpression.Operator.NOT_EQUALS) { - return infix.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ - } - break; - case ASTNode.INSTANCEOF_EXPRESSION: - InstanceofExpression instanceofExpression= (InstanceofExpression) parent; - return instanceofExpression.getRightOperand().resolveBinding(); - case ASTNode.VARIABLE_DECLARATION_FRAGMENT: - VariableDeclarationFragment frag= (VariableDeclarationFragment) parent; - if (frag.getInitializer().equals(node)) { - return frag.getName().resolveTypeBinding(); - } - break; - case ASTNode.SUPER_METHOD_INVOCATION: - SuperMethodInvocation superMethodInvocation= (SuperMethodInvocation) parent; - IMethodBinding superMethodBinding= ASTNodes.getMethodBinding(superMethodInvocation.getName()); - if (superMethodBinding != null) { - return getParameterTypeBinding(node, superMethodInvocation.arguments(), superMethodBinding); - } - break; - case ASTNode.METHOD_INVOCATION: - MethodInvocation methodInvocation= (MethodInvocation) parent; - IMethodBinding methodBinding= methodInvocation.resolveMethodBinding(); - if (methodBinding != null) { - return getParameterTypeBinding(node, methodInvocation.arguments(), methodBinding); - } - break; - case ASTNode.SUPER_CONSTRUCTOR_INVOCATION: { - SuperConstructorInvocation superInvocation= (SuperConstructorInvocation) parent; - IMethodBinding superBinding= superInvocation.resolveConstructorBinding(); - if (superBinding != null) { - return getParameterTypeBinding(node, superInvocation.arguments(), superBinding); - } - break; - } - case ASTNode.CONSTRUCTOR_INVOCATION: { - ConstructorInvocation constrInvocation= (ConstructorInvocation) parent; - IMethodBinding constrBinding= constrInvocation.resolveConstructorBinding(); - if (constrBinding != null) { - return getParameterTypeBinding(node, constrInvocation.arguments(), constrBinding); - } - break; - } - case ASTNode.CLASS_INSTANCE_CREATION: { - ClassInstanceCreation creation= (ClassInstanceCreation) parent; - IMethodBinding creationBinding= creation.resolveConstructorBinding(); - if (creationBinding != null) { - return getParameterTypeBinding(node, creation.arguments(), creationBinding); + public static String getMethodSignature(String name, ITypeBinding[] params, boolean isVarArgs) { + StringBuffer buf= new StringBuffer(); + buf.append(name).append('('); + for (int i= 0; i < params.length; i++) { + if (i > 0) { + buf.append(JavaElementLabels.COMMA_STRING); } - break; - } - case ASTNode.PARENTHESIZED_EXPRESSION: - return guessBindingForReference(parent); - case ASTNode.ARRAY_ACCESS: - if (((ArrayAccess) parent).getIndex().equals(node)) { - return parent.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ + if (isVarArgs && i == params.length - 1) { + buf.append(getTypeSignature(params[i].getElementType())); + buf.append("..."); //$NON-NLS-1$ } else { - ITypeBinding parentBinding= getPossibleReferenceBinding(parent); - if (parentBinding == null) { - parentBinding= parent.getAST().resolveWellKnownType("java.lang.Object"); //$NON-NLS-1$ - } - return parentBinding.createArrayType(1); - } - case ASTNode.ARRAY_CREATION: - if (((ArrayCreation) parent).dimensions().contains(node)) { - return parent.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ - } - break; - case ASTNode.ARRAY_INITIALIZER: - ASTNode initializerParent= parent.getParent(); - int dim= 1; - while (initializerParent instanceof ArrayInitializer) { - initializerParent= initializerParent.getParent(); - dim++; - } - Type creationType= null; - if (initializerParent instanceof ArrayCreation) { - creationType= ((ArrayCreation) initializerParent).getType(); - } else if (initializerParent instanceof VariableDeclaration) { - VariableDeclaration varDecl= (VariableDeclaration) initializerParent; - creationType= ASTNodes.getType(varDecl); - dim-= varDecl.getExtraDimensions(); - } else if (initializerParent instanceof MemberValuePair) { - String name= ((MemberValuePair) initializerParent).getName().getIdentifier(); - IMethodBinding annotMember= findAnnotationMember((Annotation) initializerParent.getParent(), name); - if (annotMember != null) { - return getReducedDimensionBinding(annotMember.getReturnType(), dim); - } - } - if (creationType instanceof ArrayType) { - ITypeBinding creationTypeBinding= ((ArrayType) creationType).resolveBinding(); - if (creationTypeBinding != null) { - return Bindings.getComponentType(creationTypeBinding, dim); - } - } - break; - case ASTNode.CONDITIONAL_EXPRESSION: - ConditionalExpression expression= (ConditionalExpression) parent; - if (node.equals(expression.getExpression())) { - return parent.getAST().resolveWellKnownType("boolean"); //$NON-NLS-1$ - } - if (node.equals(expression.getElseExpression())) { - return expression.getThenExpression().resolveTypeBinding(); - } - return expression.getElseExpression().resolveTypeBinding(); - case ASTNode.POSTFIX_EXPRESSION: - return parent.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ - case ASTNode.PREFIX_EXPRESSION: - if (((PrefixExpression) parent).getOperator() == PrefixExpression.Operator.NOT) { - return parent.getAST().resolveWellKnownType("boolean"); //$NON-NLS-1$ - } - return parent.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ - case ASTNode.IF_STATEMENT: - case ASTNode.WHILE_STATEMENT: - case ASTNode.DO_STATEMENT: - if (node instanceof Expression) { - return parent.getAST().resolveWellKnownType("boolean"); //$NON-NLS-1$ - } - break; - case ASTNode.SWITCH_STATEMENT: - if (((SwitchStatement) parent).getExpression().equals(node)) { - return parent.getAST().resolveWellKnownType("int"); //$NON-NLS-1$ - } - break; - case ASTNode.RETURN_STATEMENT: - MethodDeclaration decl= ASTResolving.findParentMethodDeclaration(parent); - if (decl != null && !decl.isConstructor()) { - return decl.getReturnType2().resolveBinding(); - } - LambdaExpression lambdaExpr= ASTResolving.findEnclosingLambdaExpression(parent); - if (lambdaExpr != null) { - IMethodBinding lambdaMethodBinding= lambdaExpr.resolveMethodBinding(); - if (lambdaMethodBinding != null && lambdaMethodBinding.getReturnType() != null) { - return lambdaMethodBinding.getReturnType(); - } - } - break; - case ASTNode.CAST_EXPRESSION: - return ((CastExpression) parent).getType().resolveBinding(); - case ASTNode.THROW_STATEMENT: - case ASTNode.CATCH_CLAUSE: - return parent.getAST().resolveWellKnownType("java.lang.Exception"); //$NON-NLS-1$ - case ASTNode.FIELD_ACCESS: - if (node.equals(((FieldAccess) parent).getName())) { - return getPossibleReferenceBinding(parent); - } - break; - case ASTNode.SUPER_FIELD_ACCESS: - return getPossibleReferenceBinding(parent); - case ASTNode.QUALIFIED_NAME: - if (node.equals(((QualifiedName) parent).getName())) { - return getPossibleReferenceBinding(parent); - } - break; - case ASTNode.SWITCH_CASE: - if (node.equals(((SwitchCase) parent).getExpression()) && parent.getParent() instanceof SwitchStatement) { - return ((SwitchStatement) parent.getParent()).getExpression().resolveTypeBinding(); - } - break; - case ASTNode.ASSERT_STATEMENT: - if (node.getLocationInParent() == AssertStatement.EXPRESSION_PROPERTY) { - return parent.getAST().resolveWellKnownType("boolean"); //$NON-NLS-1$ - } - return parent.getAST().resolveWellKnownType("java.lang.String"); //$NON-NLS-1$ - case ASTNode.SINGLE_MEMBER_ANNOTATION: { - IMethodBinding annotMember= findAnnotationMember((Annotation) parent, "value"); //$NON-NLS-1$ - if (annotMember != null) { - return annotMember.getReturnType(); - } - break; - } - case ASTNode.MEMBER_VALUE_PAIR: { - String name= ((MemberValuePair) parent).getName().getIdentifier(); - IMethodBinding annotMember= findAnnotationMember((Annotation) parent.getParent(), name); - if (annotMember != null) { - return annotMember.getReturnType(); + buf.append(getTypeSignature(params[i])); } - break; - } - default: - // do nothing } - - return null; + buf.append(')'); + return BasicElementLabels.getJavaElementName(buf.toString()); } - private static IMethodBinding findAnnotationMember(Annotation annotation, String name) { - ITypeBinding annotBinding= annotation.resolveTypeBinding(); - if (annotBinding != null) { - return Bindings.findMethodInType(annotBinding, name, (String[]) null); + public static int getPossibleTypeKinds(ASTNode node, boolean is50OrHigher) { + int kinds= internalGetPossibleTypeKinds(node); + if (!is50OrHigher) { + kinds &= (SimilarElementsRequestor.INTERFACES | SimilarElementsRequestor.CLASSES); } - return null; + return kinds; + } + + public static String getTypeSignature(ITypeBinding type) { + return BindingLabelProvider.getBindingLabel(type, BindingLabelProvider.DEFAULT_TEXTFLAGS); } public static Type guessTypeForReference(AST ast, ASTNode node) { @@ -387,495 +128,6 @@ public class ASTResolving { return null; } - private static ITypeBinding getReducedDimensionBinding(ITypeBinding arrayBinding, int dimsToReduce) { - while (dimsToReduce > 0) { - arrayBinding= arrayBinding.getComponentType(); - dimsToReduce--; - } - return arrayBinding; - } - - private static ITypeBinding getParameterTypeBinding(ASTNode node, List<Expression> args, IMethodBinding binding) { - int index= args.indexOf(node); - return getParameterTypeBinding(binding, index); - } - - public static ITypeBinding getParameterTypeBinding(IMethodBinding methodBinding, int argumentIndex) { - ITypeBinding[] paramTypes= methodBinding.getParameterTypes(); - if (methodBinding.isVarargs() && argumentIndex >= paramTypes.length - 1) { - return paramTypes[paramTypes.length - 1].getComponentType(); - } - if (argumentIndex >= 0 && argumentIndex < paramTypes.length) { - return paramTypes[argumentIndex]; - } - return null; - } - - public static ITypeBinding guessBindingForTypeReference(ASTNode node) { - StructuralPropertyDescriptor locationInParent= node.getLocationInParent(); - if (locationInParent == QualifiedName.QUALIFIER_PROPERTY) { - return null; // can't guess type for X.A - } - if (locationInParent == SimpleType.NAME_PROPERTY || - locationInParent == NameQualifiedType.NAME_PROPERTY) { - node= node.getParent(); - } - ITypeBinding binding= Bindings.normalizeTypeBinding(getPossibleTypeBinding(node)); - if (binding != null) { - if (binding.isWildcardType()) { - return normalizeWildcardType(binding, true, node.getAST()); - } - } - return binding; - } - - private static ITypeBinding getPossibleTypeBinding(ASTNode node) { - ASTNode parent= node.getParent(); - switch (parent.getNodeType()) { - case ASTNode.ARRAY_TYPE: { - int dim= ((ArrayType) parent).getDimensions(); - ITypeBinding parentBinding= getPossibleTypeBinding(parent); - if (parentBinding != null && parentBinding.getDimensions() == dim) { - return parentBinding.getElementType(); - } - return null; - } - case ASTNode.PARAMETERIZED_TYPE: { - ITypeBinding parentBinding= getPossibleTypeBinding(parent); - if (parentBinding == null || !parentBinding.isParameterizedType()) { - return null; - } - if (node.getLocationInParent() == ParameterizedType.TYPE_PROPERTY) { - return parentBinding; - } - - ITypeBinding[] typeArguments= parentBinding.getTypeArguments(); - List<Type> argumentNodes= ((ParameterizedType) parent).typeArguments(); - int index= argumentNodes.indexOf(node); - if (index != -1 && typeArguments.length == argumentNodes.size()) { - return typeArguments[index]; - } - return null; - } - case ASTNode.WILDCARD_TYPE: { - ITypeBinding parentBinding= getPossibleTypeBinding(parent); - if (parentBinding == null || !parentBinding.isWildcardType()) { - return null; - } - WildcardType wildcardType= (WildcardType) parent; - if (parentBinding.isUpperbound() == wildcardType.isUpperBound()) { - return parentBinding.getBound(); - } - return null; - } - case ASTNode.QUALIFIED_TYPE: { - ITypeBinding parentBinding= getPossibleTypeBinding(parent); - if (parentBinding == null || !parentBinding.isMember()) { - return null; - } - if (node.getLocationInParent() == QualifiedType.QUALIFIER_PROPERTY) { - return parentBinding.getDeclaringClass(); - } - return parentBinding; - } - case ASTNode.NAME_QUALIFIED_TYPE: { - ITypeBinding parentBinding= getPossibleTypeBinding(parent); - if (parentBinding == null || !parentBinding.isMember()) { - return null; - } - if (node.getLocationInParent() == NameQualifiedType.QUALIFIER_PROPERTY) { - return parentBinding.getDeclaringClass(); - } - return parentBinding; - } - case ASTNode.VARIABLE_DECLARATION_STATEMENT: - return guessVariableType(((VariableDeclarationStatement) parent).fragments()); - case ASTNode.FIELD_DECLARATION: - return guessVariableType(((FieldDeclaration) parent).fragments()); - case ASTNode.VARIABLE_DECLARATION_EXPRESSION: - return guessVariableType(((VariableDeclarationExpression) parent).fragments()); - case ASTNode.SINGLE_VARIABLE_DECLARATION: - SingleVariableDeclaration varDecl= (SingleVariableDeclaration) parent; - if (varDecl.getInitializer() != null) { - return Bindings.normalizeTypeBinding(varDecl.getInitializer().resolveTypeBinding()); - } - break; - case ASTNode.ARRAY_CREATION: - ArrayCreation creation= (ArrayCreation) parent; - if (creation.getInitializer() != null) { - return creation.getInitializer().resolveTypeBinding(); - } - return getPossibleReferenceBinding(parent); - case ASTNode.TYPE_LITERAL: - return ((TypeLiteral) parent).getType().resolveBinding(); - case ASTNode.CLASS_INSTANCE_CREATION: - return getPossibleReferenceBinding(parent); - case ASTNode.CAST_EXPRESSION: - return getPossibleReferenceBinding(parent); - case ASTNode.TAG_ELEMENT: - TagElement tagElement= (TagElement) parent; - if (TagElement.TAG_THROWS.equals(tagElement.getTagName()) || TagElement.TAG_EXCEPTION.equals(tagElement.getTagName())) { - ASTNode methNode= tagElement.getParent().getParent(); - if (methNode instanceof MethodDeclaration) { - List<Type> thrownExceptions= ((MethodDeclaration) methNode).thrownExceptionTypes(); - if (thrownExceptions.size() == 1) { - return thrownExceptions.get(0).resolveBinding(); - } - } - } - break; - } - return null; - } - - private static ITypeBinding guessVariableType(List<VariableDeclarationFragment> fragments) { - for (Iterator<VariableDeclarationFragment> iter= fragments.iterator(); iter.hasNext();) { - VariableDeclarationFragment frag= iter.next(); - if (frag.getInitializer() != null) { - return Bindings.normalizeTypeBinding(frag.getInitializer().resolveTypeBinding()); - } - } - return null; - } - - /** - * Finds all type bindings that contain a method of a given signature - * @param searchRoot the ast node to start the search from - * @param selector the method name - * @param arguments the method arguments - * @param context the context in which the method would be called - * @return returns all types known in the AST that have a method with a given name - */ - public static ITypeBinding[] getQualifierGuess(ASTNode searchRoot, final String selector, List<Expression> arguments, final IBinding context) { - final int nArgs= arguments.size(); - final ArrayList<ITypeBinding> result= new ArrayList<>(); - - // test if selector is a object method - ITypeBinding binding= searchRoot.getAST().resolveWellKnownType("java.lang.Object"); //$NON-NLS-1$ - IMethodBinding[] objectMethods= binding.getDeclaredMethods(); - for (int i= 0; i < objectMethods.length; i++) { - IMethodBinding meth= objectMethods[i]; - if (meth.getName().equals(selector) && meth.getParameterTypes().length == nArgs) { - return new ITypeBinding[] { binding }; - } - } - - visitAllBindings(searchRoot, new TypeBindingVisitor() { - private HashSet<String> fVisitedBindings= new HashSet<>(100); - - @Override - public boolean visit(ITypeBinding node) { - node= Bindings.normalizeTypeBinding(node); - if (node == null) { - return true; - } - - if (!fVisitedBindings.add(node.getKey())) { - return true; - } - if (node.isGenericType()) { - return true; // only look at parameterized types - } - if (context != null && !isUseableTypeInContext(node, context, false)) { - return true; - } - - IMethodBinding[] methods= node.getDeclaredMethods(); - for (int i= 0; i < methods.length; i++) { - IMethodBinding meth= methods[i]; - if (meth.getName().equals(selector) && meth.getParameterTypes().length == nArgs) { - result.add(node); - } - } - return true; - } - }); - return result.toArray(new ITypeBinding[result.size()]); - } - - public static void visitAllBindings(ASTNode astRoot, TypeBindingVisitor visitor) { - try { - astRoot.accept(new AllBindingsVisitor(visitor)); - } catch (AllBindingsVisitor.VisitCancelledException e) { - // visit cancelled - } - } - - private static class AllBindingsVisitor extends GenericVisitor { - private final TypeBindingVisitor fVisitor; - - private static class VisitCancelledException extends RuntimeException { - private static final long serialVersionUID= 1L; - } - public AllBindingsVisitor(TypeBindingVisitor visitor) { - super(true); - fVisitor= visitor; - } - @Override - public boolean visit(SimpleName node) { - ITypeBinding binding= node.resolveTypeBinding(); - if (binding != null) { - boolean res= fVisitor.visit(binding); - if (res) { - res= Bindings.visitHierarchy(binding, fVisitor); - } - if (!res) { - throw new VisitCancelledException(); - } - } - return false; - } - } - - - public static IBinding getParentMethodOrTypeBinding(ASTNode node) { - do { - if (node instanceof MethodDeclaration) { - return ((MethodDeclaration) node).resolveBinding(); - } else if (node instanceof AbstractTypeDeclaration) { - return ((AbstractTypeDeclaration) node).resolveBinding(); - } else if (node instanceof AnonymousClassDeclaration) { - return ((AnonymousClassDeclaration) node).resolveBinding(); - } - node= node.getParent(); - } while (node != null); - - return null; - } - - public static BodyDeclaration findParentBodyDeclaration(ASTNode node) { - while ((node != null) && (!(node instanceof BodyDeclaration))) { - node= node.getParent(); - } - return (BodyDeclaration) node; - } - - public static BodyDeclaration findParentBodyDeclaration(ASTNode node, boolean treatModifiersOutside) { - StructuralPropertyDescriptor lastLocation= null; - - while (node != null) { - if (node instanceof BodyDeclaration) { - BodyDeclaration decl= (BodyDeclaration) node; - if (!treatModifiersOutside || lastLocation != decl.getModifiersProperty()) { - return decl; - } - treatModifiersOutside= false; - } - lastLocation= node.getLocationInParent(); - node= node.getParent(); - } - return (BodyDeclaration) node; - } - - - public static CompilationUnit findParentCompilationUnit(ASTNode node) { - return (CompilationUnit) findAncestor(node, ASTNode.COMPILATION_UNIT); - } - - /** - * Finds the ancestor type of <code>node</code> (includes <code>node</code> in the search). - * - * @param node the node to start the search from, can be <code>null</code> - * @param treatModifiersOutside if set, modifiers are not part of their type, but of the type's - * parent - * @return returns the ancestor type of <code>node</code> (AbstractTypeDeclaration or - * AnonymousTypeDeclaration) if any (including <code>node</code>), <code>null</code> - * otherwise - */ - public static ASTNode findParentType(ASTNode node, boolean treatModifiersOutside) { - StructuralPropertyDescriptor lastLocation= null; - - while (node != null) { - if (node instanceof AbstractTypeDeclaration) { - AbstractTypeDeclaration decl= (AbstractTypeDeclaration) node; - if (!treatModifiersOutside || lastLocation != decl.getModifiersProperty()) { - return decl; - } - } else if (node instanceof AnonymousClassDeclaration) { - return node; - } - lastLocation= node.getLocationInParent(); - node= node.getParent(); - } - return null; - } - - /** - * Finds the ancestor type of <code>node</code> (includes <code>node</code> in the search). - * - * @param node the node to start the search from, can be <code>null</code> - * @return returns the ancestor type of <code>node</code> (AbstractTypeDeclaration or - * AnonymousTypeDeclaration) if any (including <code>node</code>), <code>null</code> - * otherwise - */ - public static ASTNode findParentType(ASTNode node) { - return findParentType(node, false); - } - - /** - * The node's enclosing method declaration or <code>null</code> if - * the node is not inside a method and is not a method declaration itself. - * - * @param node a node - * @return the enclosing method declaration or <code>null</code> - */ - public static MethodDeclaration findParentMethodDeclaration(ASTNode node) { - while (node != null) { - if (node instanceof MethodDeclaration) { - return (MethodDeclaration) node; - } else if (node instanceof BodyDeclaration || node instanceof AnonymousClassDeclaration || node instanceof LambdaExpression) { - return null; - } - node= node.getParent(); - } - return null; - } - - /** - * Returns the lambda expression node which encloses the given <code>node</code>, or - * <code>null</code> if none. - * - * @param node the node - * @return the enclosing lambda expression node for the given <code>node</code>, or - * <code>null</code> if none - * - * @since 3.10 - */ - public static LambdaExpression findEnclosingLambdaExpression(ASTNode node) { - node= node.getParent(); - while (node != null) { - if (node instanceof LambdaExpression) { - return (LambdaExpression) node; - } - if (node instanceof BodyDeclaration || node instanceof AnonymousClassDeclaration) { - return null; - } - node= node.getParent(); - } - return null; - } - - /** - * Returns the closest ancestor of <code>node</code> (including <code>node</code> itself) - * whose type is <code>nodeType</code>, or <code>null</code> if none. - * <p> - * <b>Warning:</b> This method does not stop at any boundaries like parentheses, statements, body declarations, etc. - * The resulting node may be in a totally different scope than the given node. - * Consider using one of the other {@link ASTResolving}<code>.find(..)</code> methods instead. - * </p> - * @param node the node - * @param nodeType the node type constant from {@link ASTNode} - * @return the closest ancestor of <code>node</code> (including <code>node</code> itself) - * whose type is <code>nodeType</code>, or <code>null</code> if none - */ - public static ASTNode findAncestor(ASTNode node, int nodeType) { - while ((node != null) && (node.getNodeType() != nodeType)) { - node= node.getParent(); - } - return node; - } - - public static Statement findParentStatement(ASTNode node) { - while ((node != null) && (!(node instanceof Statement))) { - node= node.getParent(); - if (node instanceof BodyDeclaration) { - return null; - } - } - return (Statement) node; - } - - public static TryStatement findParentTryStatement(ASTNode node) { - while ((node != null) && (!(node instanceof TryStatement))) { - node= node.getParent(); - if (node instanceof BodyDeclaration || node instanceof LambdaExpression) { - return null; - } - } - return (TryStatement) node; - } - - public static boolean isInsideConstructorInvocation(MethodDeclaration methodDeclaration, ASTNode node) { - if (methodDeclaration.isConstructor()) { - Statement statement= ASTResolving.findParentStatement(node); - if (statement instanceof ConstructorInvocation || statement instanceof SuperConstructorInvocation) { - return true; // argument in a this or super call - } - } - return false; - } - - public static boolean isInsideModifiers(ASTNode node) { - while (node != null && !(node instanceof BodyDeclaration)) { - if (node instanceof Annotation) { - return true; - } - node= node.getParent(); - } - return false; - } - - public static boolean isInStaticContext(ASTNode selectedNode) { - BodyDeclaration decl= ASTResolving.findParentBodyDeclaration(selectedNode); - if (decl instanceof MethodDeclaration) { - if (isInsideConstructorInvocation((MethodDeclaration) decl, selectedNode)) { - return true; - } - return Modifier.isStatic(decl.getModifiers()); - } else if (decl instanceof Initializer) { - return Modifier.isStatic(((Initializer)decl).getModifiers()); - } else if (decl instanceof FieldDeclaration) { - return JdtFlags.isStatic(decl); - } - return false; - } - - public static boolean isWriteAccess(Name selectedNode) { - ASTNode curr= selectedNode; - ASTNode parent= curr.getParent(); - while (parent != null) { - switch (parent.getNodeType()) { - case ASTNode.QUALIFIED_NAME: - if (((QualifiedName) parent).getQualifier() == curr) { - return false; - } - break; - case ASTNode.FIELD_ACCESS: - if (((FieldAccess) parent).getExpression() == curr) { - return false; - } - break; - case ASTNode.SUPER_FIELD_ACCESS: - break; - case ASTNode.ASSIGNMENT: - return ((Assignment) parent).getLeftHandSide() == curr; - case ASTNode.VARIABLE_DECLARATION_FRAGMENT: - case ASTNode.SINGLE_VARIABLE_DECLARATION: - return ((VariableDeclaration) parent).getName() == curr; - case ASTNode.POSTFIX_EXPRESSION: - return true; - case ASTNode.PREFIX_EXPRESSION: - PrefixExpression.Operator op= ((PrefixExpression) parent).getOperator(); - return op == PrefixExpression.Operator.DECREMENT || op == PrefixExpression.Operator.INCREMENT; - default: - return false; - } - - curr= parent; - parent= curr.getParent(); - } - return false; - } - - public static int getPossibleTypeKinds(ASTNode node, boolean is50OrHigher) { - int kinds= internalGetPossibleTypeKinds(node); - if (!is50OrHigher) { - kinds &= (SimilarElementsRequestor.INTERFACES | SimilarElementsRequestor.CLASSES); - } - return kinds; - } - - private static int internalGetPossibleTypeKinds(ASTNode node) { int kind= SimilarElementsRequestor.ALL_TYPES; @@ -979,236 +231,4 @@ public class ASTResolving { } return kind & mask; } - - public static String getFullName(Name name) { - return name.getFullyQualifiedName(); - } - - public static ICompilationUnit findCompilationUnitForBinding(ICompilationUnit cu, CompilationUnit astRoot, ITypeBinding binding) throws JavaModelException { - if (binding == null || !binding.isFromSource() || binding.isTypeVariable() || binding.isWildcardType()) { - return null; - } - ASTNode node= astRoot.findDeclaringNode(binding.getTypeDeclaration()); - if (node == null) { - ICompilationUnit targetCU= Bindings.findCompilationUnit(binding, cu.getJavaProject()); - if (targetCU != null) { - return targetCU; - } - return null; - } else if (node instanceof AbstractTypeDeclaration || node instanceof AnonymousClassDeclaration) { - return cu; - } - return null; - } - - - private static final Code[] CODE_ORDER= { PrimitiveType.CHAR, PrimitiveType.SHORT, PrimitiveType.INT, PrimitiveType.LONG, PrimitiveType.FLOAT, PrimitiveType.DOUBLE }; - - public static ITypeBinding[] getNarrowingTypes(AST ast, ITypeBinding type) { - ArrayList<ITypeBinding> res= new ArrayList<>(); - res.add(type); - if (type.isPrimitive()) { - Code code= PrimitiveType.toCode(type.getName()); - for (int i= 0; i < CODE_ORDER.length && code != CODE_ORDER[i]; i++) { - String typeName= CODE_ORDER[i].toString(); - res.add(ast.resolveWellKnownType(typeName)); - } - } - return res.toArray(new ITypeBinding[res.size()]); - } - - public static ITypeBinding[] getRelaxingTypes(AST ast, ITypeBinding type) { - ArrayList<ITypeBinding> res= new ArrayList<>(); - res.add(type); - if (type.isArray()) { - res.add(ast.resolveWellKnownType("java.lang.Object")); //$NON-NLS-1$ - // The following two types are not available in some j2me implementations, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=288060 : - ITypeBinding serializable= ast.resolveWellKnownType("java.io.Serializable"); //$NON-NLS-1$ - if (serializable != null) - res.add(serializable); - ITypeBinding cloneable= ast.resolveWellKnownType("java.lang.Cloneable"); //$NON-NLS-1$ - if (cloneable != null) - res.add(cloneable); - } else if (type.isPrimitive()) { - Code code= PrimitiveType.toCode(type.getName()); - boolean found= false; - for (int i= 0; i < CODE_ORDER.length; i++) { - if (found) { - String typeName= CODE_ORDER[i].toString(); - res.add(ast.resolveWellKnownType(typeName)); - } - if (code == CODE_ORDER[i]) { - found= true; - } - } - } else { - collectRelaxingTypes(res, type); - } - return res.toArray(new ITypeBinding[res.size()]); - } - - private static void collectRelaxingTypes(Collection<ITypeBinding> res, ITypeBinding type) { - ITypeBinding[] interfaces= type.getInterfaces(); - for (int i= 0; i < interfaces.length; i++) { - ITypeBinding curr= interfaces[i]; - if (!res.contains(curr)) { - res.add(curr); - } - collectRelaxingTypes(res, curr); - } - ITypeBinding binding= type.getSuperclass(); - if (binding != null) { - if (!res.contains(binding)) { - res.add(binding); - } - collectRelaxingTypes(res, binding); - } - } - - public static String[] getUsedVariableNames(ASTNode node) { - CompilationUnit root= (CompilationUnit) node.getRoot(); - Collection<String> res= (new ScopeAnalyzer(root)).getUsedVariableNames(node.getStartPosition(), node.getLength()); - return res.toArray(new String[res.size()]); - } - - private static boolean isVariableDefinedInContext(IBinding binding, ITypeBinding typeVariable) { - if (binding.getKind() == IBinding.VARIABLE) { - IVariableBinding var= (IVariableBinding) binding; - binding= var.getDeclaringMethod(); - if (binding == null) { - binding= var.getDeclaringClass(); - } - } - if (binding instanceof IMethodBinding) { - if (binding == typeVariable.getDeclaringMethod()) { - return true; - } - binding= ((IMethodBinding) binding).getDeclaringClass(); - } - - while (binding instanceof ITypeBinding) { - if (binding == typeVariable.getDeclaringClass()) { - return true; - } - if (Modifier.isStatic(binding.getModifiers())) { - break; - } - binding= ((ITypeBinding) binding).getDeclaringClass(); - } - return false; - } - - public static boolean isUseableTypeInContext(ITypeBinding type, IBinding context, boolean noWildcards) { - if (type.isArray()) { - type= type.getElementType(); - } - if (type.isAnonymous()) { - return false; - } - if (type.isRawType() || type.isPrimitive()) { - return true; - } - if (type.isTypeVariable()) { - return isVariableDefinedInContext(context, type); - } - if (type.isGenericType()) { - ITypeBinding[] typeParameters= type.getTypeParameters(); - for (int i= 0; i < typeParameters.length; i++) { - if (!isUseableTypeInContext(typeParameters[i], context, noWildcards)) { - return false; - } - } - return true; - } - if (type.isParameterizedType()) { - ITypeBinding[] typeArguments= type.getTypeArguments(); - for (int i= 0; i < typeArguments.length; i++) { - if (!isUseableTypeInContext(typeArguments[i], context, noWildcards)) { - return false; - } - } - return true; - } - if (type.isCapture()) { - type= type.getWildcard(); - } - - if (type.isWildcardType()) { - if (noWildcards) { - return false; - } - if (type.getBound() != null) { - return isUseableTypeInContext(type.getBound(), context, noWildcards); - } - } - return true; - } - - /** - * Use this method before creating a type for a wildcard. Either to assign a wildcard to a new type or for a type to be assigned. - * - * @param wildcardType the wildcard type to normalize - * @param isBindingToAssign if true, then the type X for new variable x is returned (X x= s); - * if false, the type of an expression x (R r= x) - * @param ast the current AST - * @return the normalized binding or null when only the 'null' binding - * - * @see Bindings#normalizeForDeclarationUse(ITypeBinding, AST) - */ - public static ITypeBinding normalizeWildcardType(ITypeBinding wildcardType, boolean isBindingToAssign, AST ast) { - ITypeBinding bound= wildcardType.getBound(); - if (isBindingToAssign) { - if (bound == null || !wildcardType.isUpperbound()) { - ITypeBinding[] typeBounds= wildcardType.getTypeBounds(); - if (typeBounds.length > 0) { - return typeBounds[0]; - } else { - return wildcardType.getErasure(); - } - } - } else { - if (bound == null || wildcardType.isUpperbound()) { - return null; - } - } - return bound; - } - - // pretty signatures - - public static String getTypeSignature(ITypeBinding type) { - return BindingLabelProvider.getBindingLabel(type, BindingLabelProvider.DEFAULT_TEXTFLAGS); - } - - public static String getMethodSignature(IMethodBinding binding) { - return BindingLabelProvider.getBindingLabel(binding, BindingLabelProvider.DEFAULT_TEXTFLAGS); - } - - public static String getMethodSignature(String name, ITypeBinding[] params, boolean isVarArgs) { - StringBuffer buf= new StringBuffer(); - buf.append(name).append('('); - for (int i= 0; i < params.length; i++) { - if (i > 0) { - buf.append(JavaElementLabels.COMMA_STRING); - } - if (isVarArgs && i == params.length - 1) { - buf.append(getTypeSignature(params[i].getElementType())); - buf.append("..."); //$NON-NLS-1$ - } else { - buf.append(getTypeSignature(params[i])); - } - } - buf.append(')'); - return BasicElementLabels.getJavaElementName(buf.toString()); - } - - public static CompilationUnit createQuickFixAST(ICompilationUnit compilationUnit, IProgressMonitor monitor) { - ASTParser astParser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); - astParser.setSource(compilationUnit); - astParser.setResolveBindings(true); - astParser.setStatementsRecovery(ASTProvider.SHARED_AST_STATEMENT_RECOVERY); - astParser.setBindingsRecovery(ASTProvider.SHARED_BINDING_RECOVERY); - return (CompilationUnit) astParser.createAST(monitor); - } - } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java index 2b71d85ae5..300115679a 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AdvancedQuickAssistProcessor.java @@ -88,6 +88,7 @@ import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.ASTNodes; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AssistContext.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AssistContext.java index 511d17d29a..298108fa8d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AssistContext.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/AssistContext.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -22,6 +22,8 @@ import org.eclipse.jdt.core.dom.ASTNode; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.core.dom.NodeFinder; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; + import org.eclipse.jdt.ui.SharedASTProvider; import org.eclipse.jdt.ui.text.java.IInvocationContext; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/DefaultClasspathFixProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/DefaultClasspathFixProcessor.java index 313c843c7f..41f74b5ad1 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/DefaultClasspathFixProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/DefaultClasspathFixProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -46,7 +46,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.ui.text.java.ClasspathFixProcessor; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Default contribution to org.eclipse.jdt.ui.classpathFixProcessors diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/GetterSetterCorrectionSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/GetterSetterCorrectionSubProcessor.java index bb1159fafc..b3997796a2 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/GetterSetterCorrectionSubProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/GetterSetterCorrectionSubProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 IBM Corporation and others. + * Copyright (c) 2007, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -77,7 +77,9 @@ import org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper; import org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter; import org.eclipse.jdt.internal.ui.refactoring.sef.SelfEncapsulateFieldWizard; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class GetterSetterCorrectionSubProcessor { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavadocTagsSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavadocTagsSubProcessor.java index 472f3e09bd..7f0cfad748 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavadocTagsSubProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/JavadocTagsSubProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -69,7 +69,8 @@ import org.eclipse.jdt.core.dom.rewrite.ListRewrite; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.text.java.IInvocationContext; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java index 3a81caf110..e0798812ea 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java @@ -172,7 +172,9 @@ import org.eclipse.jdt.internal.ui.text.correction.proposals.MissingAnnotationAt import org.eclipse.jdt.internal.ui.text.correction.proposals.NewVariableCorrectionProposal; import org.eclipse.jdt.internal.ui.text.correction.proposals.RefactoringCorrectionProposal; import org.eclipse.jdt.internal.ui.text.correction.proposals.ReplaceCorrectionProposal; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** */ diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java index 4f36a1de4a..3cd7bbb52b 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java @@ -97,7 +97,9 @@ import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.fix.Java50CleanUp; import org.eclipse.jdt.internal.ui.text.correction.proposals.FixCorrectionProposal; import org.eclipse.jdt.internal.ui.text.correction.proposals.ModifierChangeCorrectionProposal; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** */ diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java index a585f62381..b59790af7a 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java @@ -182,7 +182,9 @@ import org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedNamesAssistPr import org.eclipse.jdt.internal.ui.text.correction.proposals.NewDefiningMethodProposal; import org.eclipse.jdt.internal.ui.text.correction.proposals.RefactoringCorrectionProposal; import org.eclipse.jdt.internal.ui.text.correction.proposals.RenameRefactoringProposal; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReorgCorrectionsSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReorgCorrectionsSubProcessor.java index fe01f5443a..bb0106f7df 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReorgCorrectionsSubProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReorgCorrectionsSubProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -113,7 +113,7 @@ import org.eclipse.jdt.internal.ui.text.correction.proposals.CorrectPackageDecla import org.eclipse.jdt.internal.ui.text.correction.proposals.FixCorrectionProposal; import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext; import org.eclipse.jdt.internal.ui.util.CoreUtility; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement; import org.eclipse.jdt.internal.ui.wizards.buildpaths.ClasspathFixSelectionDialog; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java index 5163df75ee..02b1681315 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -57,7 +57,9 @@ import org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedCorrectionPro import org.eclipse.jdt.internal.ui.text.correction.proposals.MissingReturnTypeCorrectionProposal; import org.eclipse.jdt.internal.ui.text.correction.proposals.MissingReturnTypeInLambdaCorrectionProposal; import org.eclipse.jdt.internal.ui.text.correction.proposals.ReplaceCorrectionProposal; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java index 9cfbe0de6b..5abe22e903 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/SuppressWarningsSubProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -63,7 +63,7 @@ import org.eclipse.jdt.ui.text.java.correction.ICommandAccess; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/TypeMismatchSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/TypeMismatchSubProcessor.java index 0893fc2aac..4306cb2d7c 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/TypeMismatchSubProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/TypeMismatchSubProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -74,7 +74,9 @@ import org.eclipse.jdt.internal.ui.text.correction.proposals.ImplementInterfaceP import org.eclipse.jdt.internal.ui.text.correction.proposals.LinkedCorrectionProposal; import org.eclipse.jdt.internal.ui.text.correction.proposals.NewVariableCorrectionProposal; import org.eclipse.jdt.internal.ui.text.correction.proposals.TypeChangeCorrectionProposal; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java index 6cb94bd835..cdca2147a6 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java @@ -143,7 +143,9 @@ import org.eclipse.jdt.internal.ui.text.correction.proposals.NewMethodCorrection import org.eclipse.jdt.internal.ui.text.correction.proposals.NewVariableCorrectionProposal; import org.eclipse.jdt.internal.ui.text.correction.proposals.RenameNodeCorrectionProposal; import org.eclipse.jdt.internal.ui.text.correction.proposals.ReplaceCorrectionProposal; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; @@ -377,7 +379,7 @@ public class UnresolvedElementsSubProcessor { String label; Image image; if (senderDeclBinding.isEnum() && !isWriteAccess) { - label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createenum_description, new Object[] { nameLabel, ASTResolving.getTypeSignature(senderDeclBinding) }); + label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createenum_description, new Object[] { nameLabel, org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getTypeSignature(senderDeclBinding) }); image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC); proposals.add(new NewVariableCorrectionProposal(label, targetCU, NewVariableCorrectionProposal.ENUM_CONST, simpleName, senderDeclBinding, 10, image)); } else { @@ -386,7 +388,7 @@ public class UnresolvedElementsSubProcessor { label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createfield_description, nameLabel); image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PRIVATE); } else { - label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createfield_other_description, new Object[] { nameLabel, ASTResolving.getTypeSignature(senderDeclBinding) } ); + label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createfield_other_description, new Object[] { nameLabel, org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getTypeSignature(senderDeclBinding) } ); image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC); } int fieldRelevance= StubUtility.hasFieldName(targetCU.getJavaProject(), name) ? IProposalRelevance.CREATE_FIELD_PREFIX_OR_SUFFIX_MATCH : IProposalRelevance.CREATE_FIELD; @@ -398,7 +400,7 @@ public class UnresolvedElementsSubProcessor { label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createconst_description, nameLabel); image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PRIVATE); } else { - label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createconst_other_description, new Object[] { nameLabel, ASTResolving.getTypeSignature(senderDeclBinding) } ); + label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createconst_other_description, new Object[] { nameLabel, org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getTypeSignature(senderDeclBinding) } ); image= JavaPluginImages.get(JavaPluginImages.IMG_FIELD_PUBLIC); } int constRelevance= StubUtility.hasConstantName(targetCU.getJavaProject(), name) ? IProposalRelevance.CREATE_CONSTANT_PREFIX_OR_SUFFIX_MATCH : IProposalRelevance.CREATE_CONSTANT; @@ -511,7 +513,7 @@ public class UnresolvedElementsSubProcessor { if (NameMatcher.isSimilarName(curr.getName(), identifier)) { AST ast= astRoot.getAST(); ASTRewrite rewrite= ASTRewrite.create(ast); - String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_changetomethod_description, ASTResolving.getMethodSignature(curr)); + String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_changetomethod_description, org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(curr)); Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE); LinkedCorrectionProposal proposal= new LinkedCorrectionProposal(label, cu, rewrite, IProposalRelevance.CHANGE_TO_METHOD, image); newProposals.add(proposal); @@ -572,7 +574,7 @@ public class UnresolvedElementsSubProcessor { } private static int evauateTypeKind(ASTNode node, IJavaProject project) { - int kind= ASTResolving.getPossibleTypeKinds(node, JavaModelUtil.is50OrHigher(project)); + int kind= org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getPossibleTypeKinds(node, JavaModelUtil.is50OrHigher(project)); return kind; } @@ -1128,7 +1130,7 @@ public class UnresolvedElementsSubProcessor { Image image; ITypeBinding[] parameterTypes= getParameterTypes(arguments); if (parameterTypes != null) { - String sig= ASTResolving.getMethodSignature(methodName, parameterTypes, false); + String sig= org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodName, parameterTypes, false); boolean is18OrHigher= JavaModelUtil.is18OrHigher(targetCU.getJavaProject()); boolean isSenderBindingInterface= senderDeclBinding.isInterface(); @@ -1155,7 +1157,7 @@ public class UnresolvedElementsSubProcessor { isSenderBindingInterface= senderDeclBinding.isInterface(); if (!senderDeclBinding.isAnonymous()) { if (is18OrHigher || !isSenderBindingInterface) { - String[] args= new String[] { sig, ASTResolving.getTypeSignature(senderDeclBinding) }; + String[] args= new String[] { sig, org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getTypeSignature(senderDeclBinding) }; label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createmethod_other_description, args); if (isSenderBindingInterface) { image= JavaPluginImages.get(JavaPluginImages.IMG_MISC_PUBLIC); @@ -1315,7 +1317,7 @@ public class UnresolvedElementsSubProcessor { // add arguments { - String[] arg= new String[] { ASTResolving.getMethodSignature(methodBinding) }; + String[] arg= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodBinding) }; String label; if (diff == 1) { label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_addargument_description, arg); @@ -1344,7 +1346,7 @@ public class UnresolvedElementsSubProcessor { changeDesc[idx]= new RemoveDescription(); changedTypes[i]= declParameterTypes[idx]; } - String[] arg= new String[] { ASTResolving.getMethodSignature(methodDecl), getTypeNames(changedTypes) }; + String[] arg= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodDecl), getTypeNames(changedTypes) }; String label; if (methodDecl.isConstructor()) { if (diff == 1) { @@ -1372,7 +1374,7 @@ public class UnresolvedElementsSubProcessor { if (i > 0) { buf.append(", "); //$NON-NLS-1$ } - buf.append(ASTResolving.getTypeSignature(types[i])); + buf.append(org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getTypeSignature(types[i])); } return BasicElementLabels.getJavaElementName(buf.toString()); } @@ -1419,7 +1421,7 @@ public class UnresolvedElementsSubProcessor { for (int i= diff - 1; i >= 0; i--) { rewrite.remove(arguments.get(indexSkipped[i]), null); } - String[] arg= new String[] { ASTResolving.getMethodSignature(methodRef) }; + String[] arg= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodRef) }; String label; if (diff == 1) { label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_removeargument_description, arg); @@ -1464,7 +1466,7 @@ public class UnresolvedElementsSubProcessor { changeDesc[idx]= new InsertDescription(newType, name); changeTypes[i]= newType; } - String[] arg= new String[] { ASTResolving.getMethodSignature(methodDecl), getTypeNames(changeTypes) }; + String[] arg= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodDecl), getTypeNames(changeTypes) }; String label; if (methodDecl.isConstructor()) { if (diff == 1) { @@ -1595,7 +1597,7 @@ public class UnresolvedElementsSubProcessor { ITypeBinding[] declParamTypes= methodDecl.getParameterTypes(); ITypeBinding[] swappedTypes= new ITypeBinding[] { declParamTypes[idx1], declParamTypes[idx2] }; - String[] args= new String[] { ASTResolving.getMethodSignature(methodDecl), getTypeNames(swappedTypes) }; + String[] args= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodDecl), getTypeNames(swappedTypes) }; String label; if (methodDecl.isConstructor()) { label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_swapparams_constr_description, args); @@ -1625,7 +1627,7 @@ public class UnresolvedElementsSubProcessor { newParamTypes[i]= changeDesc[i] == null ? declParamTypes[i] : ((EditDescription) changeDesc[i]).type; } boolean isVarArgs= methodDecl.isVarargs() && newParamTypes.length > 0 && newParamTypes[newParamTypes.length - 1].isArray(); - String[] args= new String[] { ASTResolving.getMethodSignature(methodDecl), ASTResolving.getMethodSignature(methodDecl.getName(), newParamTypes, isVarArgs) }; + String[] args= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodDecl), org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature(methodDecl.getName(), newParamTypes, isVarArgs) }; String label; if (methodDecl.isConstructor()) { label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_changeparamsignature_constr_description, args); @@ -1713,7 +1715,7 @@ public class UnresolvedElementsSubProcessor { ASTRewrite rewrite= ASTRewrite.create(invocationNode.getAST()); - String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_changetoouter_description, ASTResolving.getTypeSignature(currType)); + String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_changetoouter_description, org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getTypeSignature(currType)); Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE); ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, IProposalRelevance.QUALIFY_WITH_ENCLOSING_TYPE, image); @@ -1794,7 +1796,7 @@ public class UnresolvedElementsSubProcessor { ICompilationUnit targetCU= ASTResolving.findCompilationUnitForBinding(cu, astRoot, targetDecl); if (targetCU != null) { - String[] args= new String[] { ASTResolving.getMethodSignature( ASTResolving.getTypeSignature(targetDecl), getParameterTypes(arguments), false) }; + String[] args= new String[] { org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature( org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getTypeSignature(targetDecl), getParameterTypes(arguments), false) }; String label= Messages.format(CorrectionMessages.UnresolvedElementsSubProcessor_createconstructor_description, args); Image image= JavaElementImageProvider.getDecoratedImage(JavaPluginImages.DESC_MISC_PUBLIC, JavaElementImageDescriptor.CONSTRUCTOR, JavaElementImageProvider.SMALL_SIZE); proposals.add(new NewMethodCorrectionProposal(label, targetCU, selectedNode, arguments, targetDecl, IProposalRelevance.CREATE_CONSTRUCTOR, image)); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/VarargsWarningsSubProcessor.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/VarargsWarningsSubProcessor.java index a0498ce8c0..2ec913a734 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/VarargsWarningsSubProcessor.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/VarargsWarningsSubProcessor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2012 IBM Corporation and others. + * Copyright (c) 2011, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -36,6 +36,7 @@ import org.eclipse.jdt.core.dom.Modifier; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AbstractMethodCorrectionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AbstractMethodCorrectionProposal.java index d89466c2f4..089ced10a2 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AbstractMethodCorrectionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AbstractMethodCorrectionProposal.java @@ -44,6 +44,7 @@ import org.eclipse.jdt.core.dom.TypeParameter; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.ASTNodes; @@ -52,7 +53,6 @@ import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; public abstract class AbstractMethodCorrectionProposal extends LinkedCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AddArgumentCorrectionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AddArgumentCorrectionProposal.java index f1d845c680..0cd0a84166 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AddArgumentCorrectionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AddArgumentCorrectionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -26,12 +26,12 @@ import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.ScopeAnalyzer; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; public class AddArgumentCorrectionProposal extends LinkedCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AddTypeParameterProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AddTypeParameterProposal.java index 9f9edf5210..7e20fd6021 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AddTypeParameterProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AddTypeParameterProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,10 +39,11 @@ import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; import org.eclipse.jdt.internal.ui.text.correction.JavadocTagsSubProcessor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class AddTypeParameterProposal extends LinkedCorrectionProposal { @@ -64,10 +65,10 @@ public class AddTypeParameterProposal extends LinkedCorrectionProposal { fBounds= bounds; if (binding instanceof IMethodBinding) { - String[] args= { BasicElementLabels.getJavaElementName(fTypeParamName), ASTResolving.getMethodSignature((IMethodBinding) binding) }; + String[] args= { BasicElementLabels.getJavaElementName(fTypeParamName), org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getMethodSignature((IMethodBinding) binding) }; setDisplayName(Messages.format(CorrectionMessages.AddTypeParameterProposal_method_label, args)); } else { - String[] args= { BasicElementLabels.getJavaElementName(fTypeParamName), ASTResolving.getTypeSignature((ITypeBinding) binding) }; + String[] args= { BasicElementLabels.getJavaElementName(fTypeParamName), org.eclipse.jdt.internal.ui.text.correction.ASTResolving.getTypeSignature((ITypeBinding) binding) }; setDisplayName(Messages.format(CorrectionMessages.AddTypeParameterProposal_type_label, args)); } } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AssignToVariableAssistProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AssignToVariableAssistProposal.java index 1dd2bdd5d4..366a39cfbe 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AssignToVariableAssistProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/AssignToVariableAssistProposal.java @@ -74,10 +74,11 @@ import org.eclipse.jdt.ui.cleanup.CleanUpOptions; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.javaeditor.saveparticipant.AbstractSaveParticipantPreferenceConfiguration; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; import org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Proposals for 'Assign to variable' quick assist diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CastCorrectionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CastCorrectionProposal.java index a46c372005..70565ec099 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CastCorrectionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CastCorrectionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -31,10 +31,10 @@ import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; public class CastCorrectionProposal extends LinkedCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ChangeMethodSignatureProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ChangeMethodSignatureProposal.java index 33d73e56e4..8989e261c2 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ChangeMethodSignatureProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ChangeMethodSignatureProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,6 +40,7 @@ import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; @@ -49,7 +50,6 @@ import org.eclipse.jdt.internal.corext.dom.DimensionRewrite; import org.eclipse.jdt.internal.corext.dom.LinkedNodeFinder; import org.eclipse.jdt.internal.corext.dom.ScopeAnalyzer; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.JavadocTagsSubProcessor; public class ChangeMethodSignatureProposal extends LinkedCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ConstructorFromSuperclassProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ConstructorFromSuperclassProposal.java index 88b793a390..2fb6f1a75c 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ConstructorFromSuperclassProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ConstructorFromSuperclassProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -51,7 +51,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; public class ConstructorFromSuperclassProposal extends LinkedCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CorrectMainTypeNameProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CorrectMainTypeNameProposal.java index 00217172bd..0085e9ea48 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CorrectMainTypeNameProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CorrectMainTypeNameProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,7 +30,7 @@ import org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposal; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Renames the primary type to be compatible with the name of the compilation unit. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CorrectPackageDeclarationProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CorrectPackageDeclarationProposal.java index e7f2bfc16b..0fec6500e9 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CorrectPackageDeclarationProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/CorrectPackageDeclarationProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -36,7 +36,7 @@ import org.eclipse.jdt.ui.text.java.correction.CUCorrectionProposal; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class CorrectPackageDeclarationProposal extends CUCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/EditAnnotator.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/EditAnnotator.java index e1bda1b798..e716c48e9e 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/EditAnnotator.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/EditAnnotator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 IBM Corporation and others. + * Copyright (c) 2011, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -23,7 +23,7 @@ import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; /** * Class to annotate edits made by a quick fix/assist to be shown via the quick fix pop-up preview. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ImplementInterfaceProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ImplementInterfaceProposal.java index 45c393bfea..490a347327 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ImplementInterfaceProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ImplementInterfaceProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -31,9 +31,10 @@ import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class ImplementInterfaceProposal extends LinkedCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MakeLocalVariableNonNullProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MakeLocalVariableNonNullProposal.java index 75722253da..0bfe7bdc91 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MakeLocalVariableNonNullProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MakeLocalVariableNonNullProposal.java @@ -39,7 +39,7 @@ import org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposal; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class MakeLocalVariableNonNullProposal extends ASTRewriteCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MissingAnnotationAttributesProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MissingAnnotationAttributesProposal.java index 31dda3712d..d484b57a58 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MissingAnnotationAttributesProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MissingAnnotationAttributesProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -35,10 +35,10 @@ import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; public class MissingAnnotationAttributesProposal extends LinkedCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MissingReturnTypeInLambdaCorrectionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MissingReturnTypeInLambdaCorrectionProposal.java index 964840fed8..974117f4b4 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MissingReturnTypeInLambdaCorrectionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/MissingReturnTypeInLambdaCorrectionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2014 IBM Corporation and others. + * Copyright (c) 2013, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -23,12 +23,11 @@ import org.eclipse.jdt.core.dom.LambdaExpression; import org.eclipse.jdt.core.dom.ReturnStatement; import org.eclipse.jdt.core.dom.VariableDeclarationFragment; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.dom.ScopeAnalyzer; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; - public class MissingReturnTypeInLambdaCorrectionProposal extends MissingReturnTypeCorrectionProposal { private final LambdaExpression lambdaExpression; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ModifierChangeCorrectionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ModifierChangeCorrectionProposal.java index 6e6c670788..16484868a0 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ModifierChangeCorrectionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/ModifierChangeCorrectionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -33,6 +33,7 @@ import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jdt.core.dom.VariableDeclarationStatement; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.ModifierRewrite; @@ -42,8 +43,6 @@ import org.eclipse.jdt.internal.corext.fix.LinkedProposalPositionGroup.PositionI import org.eclipse.jdt.ui.CodeGeneration; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; - public class ModifierChangeCorrectionProposal extends LinkedCorrectionProposal { private IBinding fBinding; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewAnnotationMemberProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewAnnotationMemberProposal.java index b5a21f1095..4c86bf4668 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewAnnotationMemberProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewAnnotationMemberProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -32,10 +32,10 @@ import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor; public class NewAnnotationMemberProposal extends LinkedCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewCUUsingWizardProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewCUUsingWizardProposal.java index bed3fb0fc9..5fff64c7c6 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewCUUsingWizardProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewCUUsingWizardProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -46,7 +46,7 @@ import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; -import org.eclipse.jdt.internal.corext.util.JavaModelUtil; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; @@ -61,10 +61,11 @@ import org.eclipse.jdt.ui.wizards.NewTypeWizardPage; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; import org.eclipse.jdt.internal.ui.text.correction.UnresolvedElementsSubProcessor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; import org.eclipse.jdt.internal.ui.wizards.NewAnnotationCreationWizard; import org.eclipse.jdt.internal.ui.wizards.NewClassCreationWizard; @@ -254,7 +255,7 @@ public class NewCUUsingWizardProposal extends ChangeCorrectionProposal { try { ImportRewrite rewrite= StubUtility.createImportRewrite(fCompilationUnit, true); rewrite.addImport(createdType.getFullyQualifiedName('.')); - JavaModelUtil.applyEdit(fCompilationUnit, rewrite.rewriteImports(null), false, null); + JavaElementUtil.applyEdit(fCompilationUnit, rewrite.rewriteImports(null), false, null); } catch (CoreException e) { } } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewMethodCorrectionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewMethodCorrectionProposal.java index e8c9664861..3025ca98b8 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewMethodCorrectionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewMethodCorrectionProposal.java @@ -46,6 +46,7 @@ import org.eclipse.jdt.core.dom.TypeParameter; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.ASTNodes; @@ -53,7 +54,6 @@ import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.JdtFlags; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor; public class NewMethodCorrectionProposal extends AbstractMethodCorrectionProposal { @@ -225,7 +225,7 @@ public class NewMethodCorrectionProposal extends AbstractMethodCorrectionProposa if (parent instanceof ExpressionStatement) { newTypeNode= ast.newPrimitiveType(PrimitiveType.VOID); } else { - newTypeNode= ASTResolving.guessTypeForReference(ast, node); + newTypeNode= org.eclipse.jdt.internal.ui.text.correction.ASTResolving.guessTypeForReference(ast, node); if (newTypeNode == null) { newTypeNode= ast.newSimpleType(ast.newSimpleName("Object")); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewVariableCorrectionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewVariableCorrectionProposal.java index 8a66ead3ac..366643e641 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewVariableCorrectionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/NewVariableCorrectionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -62,13 +62,14 @@ import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.Bindings; +import org.eclipse.jdt.internal.corext.dom.BodyDeclarationRewrite; import org.eclipse.jdt.internal.corext.dom.LinkedNodeFinder; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.JavadocTagsSubProcessor; import org.eclipse.jdt.internal.ui.text.correction.ModifierCorrectionSubProcessor; @@ -372,9 +373,9 @@ public class NewVariableCorrectionProposal extends LinkedCorrectionProposal { private ASTNode getDominantNode(SimpleName[] names) { - ASTNode dominator= names[0]; //ASTResolving.findParentStatement(names[0]); + ASTNode dominator= names[0]; //ASTResolvingUtil.findParentStatement(names[0]); for (int i= 1; i < names.length; i++) { - ASTNode curr= names[i];// ASTResolving.findParentStatement(names[i]); + ASTNode curr= names[i];// ASTResolvingUtil.findParentStatement(names[i]); if (curr != dominator) { ASTNode parent= getCommonParent(curr, dominator); @@ -463,12 +464,12 @@ public class NewVariableCorrectionProposal extends LinkedCorrectionProposal { for (int i= decls.size() - 1; i >= 0; i--) { BodyDeclaration curr= decls.get(i); if (maxOffset > curr.getStartPosition() + curr.getLength()) { - return ASTNodes.getInsertionIndex(newDecl, decls.subList(0, i + 1)); + return BodyDeclarationRewrite.getInsertionIndex(newDecl, decls.subList(0, i + 1)); } } return 0; } - return ASTNodes.getInsertionIndex(newDecl, decls); + return BodyDeclarationRewrite.getInsertionIndex(newDecl, decls); } private Type evaluateVariableType(AST ast, ImportRewrite imports, ImportRewriteContext importRewriteContext, IBinding targetContext) { @@ -505,7 +506,7 @@ public class NewVariableCorrectionProposal extends LinkedCorrectionProposal { return imports.addImport(binding, ast, importRewriteContext); } // no binding, find type AST node instead -> ABC a= x-> use 'ABC' as is - Type type= ASTResolving.guessTypeForReference(ast, fOriginalNode); + Type type= org.eclipse.jdt.internal.ui.text.correction.ASTResolving.guessTypeForReference(ast, fOriginalNode); if (type != null) { return type; } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/RemoveDeclarationCorrectionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/RemoveDeclarationCorrectionProposal.java index 6dc4a2c59f..8fab7b852f 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/RemoveDeclarationCorrectionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/RemoveDeclarationCorrectionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -54,7 +54,7 @@ import org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposal; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; import org.eclipse.jdt.internal.ui.text.correction.JavadocTagsSubProcessor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class RemoveDeclarationCorrectionProposal extends ASTRewriteCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/TypeChangeCorrectionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/TypeChangeCorrectionProposal.java index daae111004..276b689886 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/TypeChangeCorrectionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/TypeChangeCorrectionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -52,10 +52,11 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; import org.eclipse.jdt.internal.ui.text.correction.JavadocTagsSubProcessor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; + +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; public class TypeChangeCorrectionProposal extends LinkedCorrectionProposal { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java index 6e78b135a3..5ba5b509ac 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/AnonymousTypeCompletionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -65,14 +65,14 @@ import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.dialogs.OverrideMethodDialog; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; @@ -158,7 +158,7 @@ public class AnonymousTypeCompletionProposal extends JavaTypeCompletionProposal workingCopy.getBuffer().setContents(workingCopyContents.toString()); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setResolveBindings(true); parser.setStatementsRecovery(true); parser.setSource(workingCopy); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/GetterSetterCompletionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/GetterSetterCompletionProposal.java index fb5b3a4882..38f38cb6b6 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/GetterSetterCompletionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/GetterSetterCompletionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -38,13 +38,13 @@ import org.eclipse.jdt.internal.corext.codemanipulation.GetterSetterUtil; import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil; import org.eclipse.jdt.internal.corext.util.JdtFlags; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class GetterSetterCompletionProposal extends JavaTypeCompletionProposal implements ICompletionProposalExtension4 { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java index 3351030cf8..ba2f1bff70 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaAutoIndentStrategy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -60,7 +60,7 @@ import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.ui.text.IJavaPartitions; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner; import org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner; @@ -536,7 +536,7 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy { CompilationUnit compilationUnit= null; try { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(info.buffer); compilationUnit= (CompilationUnit) parser.createAST(null); } catch (ArrayIndexOutOfBoundsException x) { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaReconcilingStrategy.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaReconcilingStrategy.java index 2d6a8a42e7..542e5e4a6c 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaReconcilingStrategy.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaReconcilingStrategy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -39,7 +39,7 @@ import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.javaeditor.WorkingCopyManager; public class JavaReconcilingStrategy implements IReconcilingStrategy, IReconcilingStrategyExtension { @@ -120,12 +120,12 @@ public class JavaReconcilingStrategy implements IReconcilingStrategy, IReconcili // reconcile if (fIsJavaReconcilingListener && isASTNeeded) { int reconcileFlags= ICompilationUnit.FORCE_PROBLEM_DETECTION; - if (ASTProvider.SHARED_AST_STATEMENT_RECOVERY) + if (IASTSharedValues.SHARED_AST_STATEMENT_RECOVERY) reconcileFlags|= ICompilationUnit.ENABLE_STATEMENTS_RECOVERY; - if (ASTProvider.SHARED_BINDING_RECOVERY) + if (IASTSharedValues.SHARED_BINDING_RECOVERY) reconcileFlags|= ICompilationUnit.ENABLE_BINDINGS_RECOVERY; - CompilationUnit ast= unit.reconcile(ASTProvider.SHARED_AST_LEVEL, reconcileFlags, null, fProgressMonitor); + CompilationUnit ast= unit.reconcile(IASTSharedValues.SHARED_AST_LEVEL, reconcileFlags, null, fProgressMonitor); if (ast != null) { // mark as unmodifiable ASTNodes.setFlagsToAST(ast, ASTNode.PROTECT); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/LazyGenericTypeProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/LazyGenericTypeProposal.java index fa85f3c460..b573df540b 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/LazyGenericTypeProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/LazyGenericTypeProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -59,12 +59,12 @@ import org.eclipse.jdt.core.dom.ITypeBinding; import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.internal.corext.template.java.SignatureUtil; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.javaeditor.EditorHighlightingSynchronizer; import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; @@ -628,7 +628,7 @@ public class LazyGenericTypeProposal extends LazyJavaTypeCompletionProposal { keys[i]= String.valueOf(chKeys[0]); } - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(fCompilationUnit.getJavaProject()); parser.setResolveBindings(true); parser.setStatementsRecovery(true); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/MethodDeclarationCompletionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/MethodDeclarationCompletionProposal.java index b690418502..c9ee5f73b8 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/MethodDeclarationCompletionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/MethodDeclarationCompletionProposal.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -35,7 +35,7 @@ import org.eclipse.jdt.core.formatter.CodeFormatter; import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings; import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil; import org.eclipse.jdt.internal.corext.util.JavaConventionsUtil; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaElementImageDescriptor; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/OverrideCompletionProposal.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/OverrideCompletionProposal.java index b57849ddb3..a7a8214403 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/OverrideCompletionProposal.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/OverrideCompletionProposal.java @@ -45,6 +45,7 @@ import org.eclipse.jdt.core.dom.rewrite.ImportRewrite.ImportRewriteContext; import org.eclipse.jdt.core.dom.rewrite.ListRewrite; import org.eclipse.jdt.core.formatter.IndentManipulation; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; @@ -54,9 +55,8 @@ import org.eclipse.jdt.internal.corext.dom.Bindings; import org.eclipse.jdt.ui.SharedASTProvider; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; public class OverrideCompletionProposal extends JavaTypeCompletionProposal implements ICompletionProposalExtension4 { @@ -109,7 +109,7 @@ public class OverrideCompletionProposal extends JavaTypeCompletionProposal imple recoveredDocument.set(new String(content)); - final ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + final ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setResolveBindings(true); parser.setStatementsRecovery(true); parser.setSource(content); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaSourceHover.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaSourceHover.java index b304e07d48..7f5e2a4d8c 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaSourceHover.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavaSourceHover.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -56,7 +56,7 @@ import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.TokenScanner; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.SharedASTProvider; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavadocHover.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavadocHover.java index 80ea93544e..00cd885118 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavadocHover.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/JavadocHover.java @@ -113,11 +113,11 @@ import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.actions.OpenBrowserUtil; import org.eclipse.jdt.internal.ui.actions.SimpleSelectionProvider; import org.eclipse.jdt.internal.ui.infoviews.JavadocView; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart; import org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLinks; @@ -809,7 +809,7 @@ public class JavadocHover extends AbstractJavaEditorTextHover { if (element.getJavaProject().getOption(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, true).equals(JavaCore.ENABLED)) { if (node == null) { if (element instanceof ISourceReference) { - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setProject(element.getJavaProject()); p.setBindingsRecovery(true); try { @@ -1078,7 +1078,7 @@ public class JavadocHover extends AbstractJavaEditorTextHover { ASTNode node= getHoveredASTNode(editorInputElement, hoverRegion); if (node == null) { - ASTParser p= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser p= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); p.setProject(element.getJavaProject()); p.setBindingsRecovery(true); try { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/NLSStringHover.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/NLSStringHover.java index 65a93956c0..beaea6d87b 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/NLSStringHover.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/hover/NLSStringHover.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -50,6 +50,7 @@ import org.eclipse.jdt.core.dom.SimpleName; import org.eclipse.jdt.core.dom.StringLiteral; import org.eclipse.jdt.core.dom.TypeDeclaration; +import org.eclipse.jdt.internal.core.manipulation.dom.ASTResolving; import org.eclipse.jdt.internal.corext.refactoring.nls.AccessorClassReference; import org.eclipse.jdt.internal.corext.refactoring.nls.NLSHintHelper; @@ -58,7 +59,6 @@ import org.eclipse.jdt.ui.SharedASTProvider; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; import org.eclipse.jdt.internal.ui.javaeditor.NLSKeyHyperlink; -import org.eclipse.jdt.internal.ui.text.correction.ASTResolving; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocAutoIndentStrategy.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocAutoIndentStrategy.java index 0f877dbb0a..9284de3e8a 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocAutoIndentStrategy.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavaDocAutoIndentStrategy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -41,7 +41,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.MethodOverrideTester; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache; import org.eclipse.jdt.ui.CodeGeneration; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavadocContentAccess2.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavadocContentAccess2.java index 3c3b722632..a1d4807300 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavadocContentAccess2.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/javadoc/JavadocContentAccess2.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -104,7 +104,7 @@ import org.eclipse.jdt.ui.JavadocContentAccess; import org.eclipse.jdt.ui.SharedASTProvider; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLinks; @@ -743,7 +743,7 @@ public class JavadocContentAccess2 { private static CompilationUnit createAST(IJavaElement element, String cuSource) { Assert.isNotNull(element); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); IJavaProject javaProject= element.getJavaProject(); parser.setProject(javaProject); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/spelling/engine/AbstractSpellDictionary.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/spelling/engine/AbstractSpellDictionary.java index 5b51166a68..161f33ae22 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/spelling/engine/AbstractSpellDictionary.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/spelling/engine/AbstractSpellDictionary.java @@ -42,7 +42,7 @@ import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/CoreUtility.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/CoreUtility.java index fd8a6c30d3..1992474d02 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/CoreUtility.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/CoreUtility.java @@ -37,7 +37,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; public class CoreUtility { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/PatternMatcher.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/PatternMatcher.java index 76df5aaa45..ace3ab654d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/PatternMatcher.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/PatternMatcher.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -13,7 +13,7 @@ package org.eclipse.jdt.internal.ui.util; import org.eclipse.jdt.core.search.SearchPattern; import org.eclipse.jdt.internal.corext.util.SearchUtils; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; /** * A pattern matcher can match strings against various kinds of patterns supported by {@link SearchPattern}: diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/TypeNameMatchLabelProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/TypeNameMatchLabelProvider.java index ae2c9e6335..3c479376dc 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/TypeNameMatchLabelProvider.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/TypeNameMatchLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,7 +25,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.JavaUIMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; public class TypeNameMatchLabelProvider extends LabelProvider { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/BasicElementLabels.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/BasicElementLabels.java index fa0f58048c..63a4b02f11 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/BasicElementLabels.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/BasicElementLabels.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,148 +10,21 @@ *******************************************************************************/ package org.eclipse.jdt.internal.ui.viewsupport; -import java.io.File; - -import org.eclipse.osgi.util.TextProcessor; - -import org.eclipse.core.runtime.IPath; - -import org.eclipse.core.resources.IResource; - import org.eclipse.ui.IWorkingSet; -import org.eclipse.jdt.core.ITypeRoot; - -import org.eclipse.jdt.internal.corext.util.Strings; - -import org.eclipse.jdt.ui.JavaElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; +import org.eclipse.jdt.internal.corext.util.JDTUIHelperClasses; /** * A label provider for basic elements like paths. The label provider will make sure that the labels are correctly * shown in RTL environments. * + * @see JDTUIHelperClasses * @since 3.4 */ -public class BasicElementLabels { - - - // TextProcessor delimiters - private static final String CODE_DELIMITERS= TextProcessor.getDefaultDelimiters() + "<>()?,{}+-*!%=^|&;[]~"; //$NON-NLS-1$ - private static final String FILE_PATTERN_DELIMITERS= TextProcessor.getDefaultDelimiters() + "*.?"; //$NON-NLS-1$ - private static final String URL_DELIMITERS= TextProcessor.getDefaultDelimiters() + ":@?-"; //$NON-NLS-1$ - +public class BasicElementLabels extends org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels { /** - * Returns the label of a path. - * - * @param path the path - * @param isOSPath if <code>true</code>, the path represents an OS path, if <code>false</code> it is a workspace path. - * @return the label of the path to be used in the UI. - */ - public static String getPathLabel(IPath path, boolean isOSPath) { - String label; - if (isOSPath) { - label= path.toOSString(); - } else { - label= path.makeRelative().toString(); - } - return Strings.markLTR(label); - } - - /** - * Returns the label of the path of a file. - * - * @param file the file - * @return the label of the file path to be used in the UI. - */ - public static String getPathLabel(File file) { - return Strings.markLTR(file.getAbsolutePath()); - } - - /** - * Returns the label for a file pattern like '*.java' - * - * @param name the pattern - * @return the label of the pattern. - */ - public static String getFilePattern(String name) { - return Strings.markLTR(name, FILE_PATTERN_DELIMITERS); - } - - /** - * Returns the label for a URL, URI or URL part. Example is 'http://www.x.xom/s.html#1' - * - * @param name the URL string - * @return the label of the URL. - */ - public static String getURLPart(String name) { - return Strings.markLTR(name, URL_DELIMITERS); - } - - /** - * Returns a label for a resource name. - * - * @param resource the resource - * @return the label of the resource name. - */ - public static String getResourceName(IResource resource) { - return Strings.markLTR(resource.getName()); - } - - /** - * Returns a label for a resource name. - * - * @param resourceName the resource name - * @return the label of the resource name. - */ - public static String getResourceName(String resourceName) { - return Strings.markLTR(resourceName); - } - - /** - * Returns a label for a type root name which is a file name. - * - * @param typeRoot the typeRoot - * @return the label of the resource name. - */ - public static String getFileName(ITypeRoot typeRoot) { - return Strings.markLTR(typeRoot.getElementName()); - } - - /** - * Returns a label for Java element name. Example is 'new Test<? extends List>() { ...}'. - * This method should only be used for simple element names. Use - * {@link JavaElementLabels} to create a label from a Java element or {@link BindingLabelProvider} - * for labels of bindings. - * - * @param name the Java element name. - * @return the label for the Java element - */ - public static String getJavaElementName(String name) { - return Strings.markJavaElementLabelLTR(name); - } - - /** - * Returns a label for Java code snippet used in a label. Example is 'Test test= new Test<? extends List>() { ...}'. - * - * @param string the Java code snippet - * @return the label for the Java code snippet - */ - public static String getJavaCodeString(String string) { - return Strings.markLTR(string, CODE_DELIMITERS); - } - - /** - * Returns a label for a version name. Example is '1.4.1' - * - * @param name the version string - * @return the version label - */ - public static String getVersionName(String name) { - return Strings.markLTR(name); - } - - /** * Returns a label for a working set * * @param set the working set diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/BindingLabelProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/BindingLabelProvider.java index 4316d3b0fc..e44f88bc5d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/BindingLabelProvider.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/BindingLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,7 +24,7 @@ import org.eclipse.jdt.core.dom.IVariableBinding; import org.eclipse.jdt.core.dom.Modifier; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.JavaElementImageDescriptor; import org.eclipse.jdt.ui.JavaElementLabels; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java index c9441250a2..85b53aa77d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -44,7 +44,7 @@ import org.eclipse.jdt.core.dom.IBinding; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.internal.corext.util.SuperTypeHierarchyCache; import org.eclipse.jdt.ui.JavaElementLabels; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/StatusBarUpdater.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/StatusBarUpdater.java index d5e9ed9551..65bcdf2652 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/StatusBarUpdater.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/StatusBarUpdater.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -35,6 +35,8 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaUIMessages; import org.eclipse.jdt.internal.ui.packageview.PackageFragmentRootContainer; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; + /** * Add the <code>StatusBarUpdater</code> to your ViewPart to have the statusbar * describing the selected elements. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/StorageLabelProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/StorageLabelProvider.java index eedb20cd11..4038776e85 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/StorageLabelProvider.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/StorageLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -31,6 +31,8 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.jdt.core.IJarEntryResource; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; + /** * Standard label provider for IStorage objects. * Use this class when you want to present IStorage objects in a viewer. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/ClassPathDetector.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/ClassPathDetector.java index cf6193061c..fdb961f8ab 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/ClassPathDetector.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/ClassPathDetector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -57,8 +57,8 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** */ @@ -284,7 +284,7 @@ public class ClassPathDetector implements IResourceProxyVisitor { private void visitCompilationUnit(IFile file) { ICompilationUnit cu= JavaCore.createCompilationUnitFrom(file); if (cu != null) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setFocalPosition(0); CompilationUnit root= (CompilationUnit)parser.createAST(null); diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewSourceFolderWizardPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewSourceFolderWizardPage.java index 6e98d51c23..ad34ec6555 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewSourceFolderWizardPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewSourceFolderWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -77,7 +77,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.util.CoreUtility; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/SuperInterfaceSelectionDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/SuperInterfaceSelectionDialog.java index dba9293cca..e385add2dc 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/SuperInterfaceSelectionDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/SuperInterfaceSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -45,7 +45,7 @@ import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.OpenTypeSelectionDialog; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * A type selection dialog providing means to open interface(s). diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRuleEntryDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRuleEntryDialog.java index 6be91d0bf8..a0f742de1d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRuleEntryDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRuleEntryDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -32,7 +32,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.dialogfields.ComboDialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRulesDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRulesDialog.java index 1b77f135cf..616d4a9af5 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRulesDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRulesDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -50,7 +50,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.preferences.ProblemSeveritiesPreferencePage; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRulesLabelProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRulesLabelProvider.java index 5d680e02c3..1993b39512 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRulesLabelProvider.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AccessRulesLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -19,7 +19,7 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jdt.core.IAccessRule; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; public class AccessRulesLabelProvider extends LabelProvider implements ITableLabelProvider { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AddSourceFolderWizardPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AddSourceFolderWizardPage.java index 7c5dd31a60..1a33e83304 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AddSourceFolderWizardPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/AddSourceFolderWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -74,7 +74,7 @@ import org.eclipse.jdt.ui.wizards.NewElementWizardPage; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator; import org.eclipse.jdt.internal.ui.wizards.TypedViewerFilter; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java index 8fc814c96a..cc13e821b0 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -86,7 +86,7 @@ import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.dialogs.StatusUtil; import org.eclipse.jdt.internal.ui.util.CoreUtility; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.ImageDisposer; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListLabelProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListLabelProvider.java index 4126700430..7c8e319d90 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListLabelProvider.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -44,7 +44,7 @@ import org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration.ClasspathAttri import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.ImageDescriptorRegistry; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPVariableElementLabelProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPVariableElementLabelProvider.java index 578ae9bee2..90059a5fba 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPVariableElementLabelProvider.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPVariableElementLabelProvider.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ClasspathFixSelectionDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ClasspathFixSelectionDialog.java index 9e052db908..79fbb10d7a 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ClasspathFixSelectionDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ClasspathFixSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -66,7 +66,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.text.correction.ClasspathFixProcessorDescriptor; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CreateMultipleSourceFoldersDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CreateMultipleSourceFoldersDialog.java index 169b16aed9..f476f65827 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CreateMultipleSourceFoldersDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CreateMultipleSourceFoldersDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -56,7 +56,7 @@ import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.ui.actions.AbstractOpenWizardAction; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.TypedViewerFilter; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/EditVariableEntryDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/EditVariableEntryDialog.java index cf2fb11fe7..6070e3d8be 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/EditVariableEntryDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/EditVariableEntryDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -38,7 +38,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExclusionInclusionDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExclusionInclusionDialog.java index 35ad9007e9..64f1ff9e60 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExclusionInclusionDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExclusionInclusionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -44,7 +44,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.ImageDescriptorRegistry; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExclusionInclusionEntryDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExclusionInclusionEntryDialog.java index 7660d9d068..69bb4291f3 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExclusionInclusionEntryDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExclusionInclusionEntryDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -46,7 +46,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator; import org.eclipse.jdt.internal.ui.wizards.TypedViewerFilter; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExternalAnnotationsAttachmentBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExternalAnnotationsAttachmentBlock.java index 841ed495cb..57d1c0dfbc 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExternalAnnotationsAttachmentBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExternalAnnotationsAttachmentBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -63,7 +63,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExternalAnnotationsAttributeConfiguration.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExternalAnnotationsAttributeConfiguration.java index d967154031..429ad4aef5 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExternalAnnotationsAttributeConfiguration.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExternalAnnotationsAttributeConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,7 +27,7 @@ import org.eclipse.jdt.ui.wizards.BuildPathDialogAccess; import org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; public class ExternalAnnotationsAttributeConfiguration extends ClasspathAttributeConfiguration { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/JARFileSelectionDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/JARFileSelectionDialog.java index 040012cfb0..248f5c1499 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/JARFileSelectionDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/JARFileSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -30,7 +30,7 @@ import org.eclipse.ui.dialogs.ISelectionStatusValidator; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.FilteredElementTreeSelectionDialog; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/JavadocAttributeConfiguration.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/JavadocAttributeConfiguration.java index 9e6087e9e7..9e611b1beb 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/JavadocAttributeConfiguration.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/JavadocAttributeConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,7 +27,7 @@ import org.eclipse.jdt.ui.wizards.BuildPathDialogAccess; import org.eclipse.jdt.ui.wizards.ClasspathAttributeConfiguration; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; public class JavadocAttributeConfiguration extends ClasspathAttributeConfiguration { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java index d74e0b4d5c..9af96fab31 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -70,7 +70,7 @@ import org.eclipse.jdt.internal.ui.actions.JarImportWizardAction; import org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter; import org.eclipse.jdt.internal.ui.jarimport.JarImportWizard; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.dialogfields.CheckedListDialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/OutputLocationDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/OutputLocationDialog.java index 1baf5014ac..6093e032f2 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/OutputLocationDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/OutputLocationDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -57,7 +57,7 @@ import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator; import org.eclipse.jdt.internal.ui.wizards.TypedViewerFilter; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SetFilterWizardPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SetFilterWizardPage.java index 05ff6c82bb..6de9d466b1 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SetFilterWizardPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SetFilterWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -46,7 +46,7 @@ import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.ImageDescriptorRegistry; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java index 91c364c12c..7efafbb010 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -63,7 +63,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.dialogfields.ComboDialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/UserLibraryMarkerResolutionGenerator.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/UserLibraryMarkerResolutionGenerator.java index c59c537c34..af66d7f5ba 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/UserLibraryMarkerResolutionGenerator.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/UserLibraryMarkerResolutionGenerator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -51,7 +51,7 @@ import org.eclipse.jdt.internal.ui.preferences.BuildPathsPropertyPage; import org.eclipse.jdt.internal.ui.preferences.UserLibraryPreferencePage; import org.eclipse.jdt.internal.ui.text.correction.CorrectionMessages; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/AddFolderToBuildpathAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/AddFolderToBuildpathAction.java index 8dbe623584..7481f37450 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/AddFolderToBuildpathAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/AddFolderToBuildpathAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -57,7 +57,7 @@ import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathBasePage; import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/AddSelectedLibraryToBuildpathAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/AddSelectedLibraryToBuildpathAction.java index 44503ce927..67c560cc30 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/AddSelectedLibraryToBuildpathAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/AddSelectedLibraryToBuildpathAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,7 +43,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/ClasspathModifierQueries.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/ClasspathModifierQueries.java index 0adfccfc9d..81c21b7e63 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/ClasspathModifierQueries.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/ClasspathModifierQueries.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -36,7 +36,7 @@ import org.eclipse.jdt.ui.PreferenceConstants; import org.eclipse.jdt.ui.wizards.BuildPathDialogAccess; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement; import org.eclipse.jdt.internal.ui.wizards.buildpaths.ExclusionInclusionDialog; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/EditOutputFolderAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/EditOutputFolderAction.java index f53578ee90..63a5e77b63 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/EditOutputFolderAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/EditOutputFolderAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -49,7 +49,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement; import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElementAttribute; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/IncludeToBuildpathAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/IncludeToBuildpathAction.java index 79b8ce17e6..cbcfc7b021 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/IncludeToBuildpathAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/IncludeToBuildpathAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,7 +43,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/RemoveLinkedFolderDialog.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/RemoveLinkedFolderDialog.java index a942b322c5..7cfc42d70d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/RemoveLinkedFolderDialog.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/newsourcepage/RemoveLinkedFolderDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -29,7 +29,7 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.buildpaths.newsourcepage.ClasspathModifierQueries.IRemoveLinkedFolderQuery; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/ConfigureWorkingSetAssignementAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/ConfigureWorkingSetAssignementAction.java index ab67700ce3..0c6552ce24 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/ConfigureWorkingSetAssignementAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/workingsets/ConfigureWorkingSetAssignementAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -649,7 +649,7 @@ public final class ConfigureWorkingSetAssignementAction extends SelectionDispatc IAdaptable element= elements[0]; String elementName; if (element instanceof IResource) { - elementName= BasicElementLabels.getResourceName((IResource) element); + elementName= org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels.getResourceName((IResource) element); } else { elementName= JavaElementLabels.getElementLabel((IJavaElement)element, JavaElementLabels.ALL_DEFAULT); } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabels.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabels.java index 1a8152e954..8b66eea514 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabels.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabels.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -46,7 +46,8 @@ import org.eclipse.jdt.launching.JavaRuntime; import org.eclipse.jdt.internal.ui.JavaUIMessages; import org.eclipse.jdt.internal.ui.packageview.ClassPathContainer; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; + import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabelComposer; @@ -412,7 +413,7 @@ public class JavaElementLabels { } else if (obj instanceof IAdaptable) { IWorkbenchAdapter wbadapter= ((IAdaptable)obj).getAdapter(IWorkbenchAdapter.class); if (wbadapter != null) { - return Strings.markLTR(wbadapter.getLabel(obj)); + return org.eclipse.jdt.internal.core.manipulation.util.Strings.markLTR(wbadapter.getLabel(obj)); } } return ""; //$NON-NLS-1$ @@ -489,7 +490,7 @@ public class JavaElementLabels { public static String getElementLabel(IJavaElement element, long flags) { StringBuffer result= new StringBuffer(); getElementLabel(element, flags, result); - return Strings.markJavaElementLabelLTR(result.toString()); + return org.eclipse.jdt.internal.core.manipulation.util.Strings.markJavaElementLabelLTR(result.toString()); } /** @@ -814,11 +815,11 @@ public class JavaElementLabels { public static String getContainerEntryLabel(IPath containerPath, IJavaProject project) throws JavaModelException { IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, project); if (container != null) { - return Strings.markLTR(container.getDescription()); + return org.eclipse.jdt.internal.core.manipulation.util.Strings.markLTR(container.getDescription()); } ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(containerPath.segment(0)); if (initializer != null) { - return Strings.markLTR(initializer.getDescription(containerPath, project)); + return org.eclipse.jdt.internal.core.manipulation.util.Strings.markLTR(initializer.getDescription(containerPath, project)); } return BasicElementLabels.getPathLabel(containerPath, false); } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java index dfa470cdd0..bc8bc1f1fe 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddGetterSetterAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -95,13 +95,13 @@ import org.eclipse.jdt.internal.ui.actions.SelectionConverter; import org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter; import org.eclipse.jdt.internal.ui.dialogs.SourceActionDialog; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext; import org.eclipse.jdt.internal.ui.util.ElementValidator; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; /** @@ -331,7 +331,7 @@ public class AddGetterSetterAction extends SelectionDispatchAction { setterFields= getSetterOnlyFields(result, keySet); getterSetterFields= getGetterSetterFields(result, keySet); } - generate(type, getterFields, setterFields, getterSetterFields, new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL).parse(type.getCompilationUnit(), true), dialog.getElementPosition()); + generate(type, getterFields, setterFields, getterSetterFields, new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL).parse(type.getCompilationUnit(), true), dialog.getElementPosition()); } notifyResult(dialogResult == Window.OK); } diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddToClasspathAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddToClasspathAction.java index cbd93d197a..c13bd2e89f 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddToClasspathAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddToClasspathAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -42,7 +42,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.ActionMessages; import org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.buildpaths.ArchiveFileFilter; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddUnimplementedConstructorsAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddUnimplementedConstructorsAction.java index 3503c20f1d..75881367ee 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddUnimplementedConstructorsAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AddUnimplementedConstructorsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -81,7 +81,7 @@ import org.eclipse.jdt.internal.ui.actions.SelectionConverter; import org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter; import org.eclipse.jdt.internal.ui.dialogs.SourceActionDialog; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; import org.eclipse.jdt.internal.ui.refactoring.IVisibilityChangeListener; @@ -120,7 +120,7 @@ public class AddUnimplementedConstructorsAction extends SelectionDispatchAction private final CompilationUnit fUnit; public AddUnimplementedConstructorsContentProvider(IType type) throws JavaModelException { - RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); + RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); fUnit= parser.parse(type.getCompilationUnit(), true); AbstractTypeDeclaration declaration= (AbstractTypeDeclaration) ASTNodes.getParent(NodeFinder.perform(fUnit, type.getNameRange()), AbstractTypeDeclaration.class); if (declaration != null) { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ExternalizeStringsAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ExternalizeStringsAction.java index 28baa1f767..a310f9e2cd 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ExternalizeStringsAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/ExternalizeStringsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -82,7 +82,7 @@ import org.eclipse.jdt.internal.ui.actions.SelectionConverter; import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor; import org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizard; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/FindOccurrencesInFileAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/FindOccurrencesInFileAction.java index 8d74b2b7b6..1b9555e7fe 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/FindOccurrencesInFileAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/FindOccurrencesInFileAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,7 +43,7 @@ import org.eclipse.jdt.internal.ui.actions.ActionUtil; import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; import org.eclipse.jdt.internal.ui.javaeditor.JavaTextSelection; import org.eclipse.jdt.internal.ui.search.FindOccurrencesEngine; -import org.eclipse.jdt.internal.ui.search.OccurrencesFinder; +import org.eclipse.jdt.internal.core.manipulation.search.OccurrencesFinder; import org.eclipse.jdt.internal.ui.search.SearchMessages; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/FindStringsToExternalizeAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/FindStringsToExternalizeAction.java index c4ecfb2fc0..3ba9744235 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/FindStringsToExternalizeAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/FindStringsToExternalizeAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -72,7 +72,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.ActionMessages; import org.eclipse.jdt.internal.ui.refactoring.nls.ExternalizeWizard; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateHashCodeEqualsAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateHashCodeEqualsAction.java index 3d954f9bb9..340058aa4b 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateHashCodeEqualsAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateHashCodeEqualsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -45,7 +45,7 @@ import org.eclipse.jdt.internal.ui.actions.SelectionConverter; import org.eclipse.jdt.internal.ui.dialogs.GenerateHashCodeEqualsDialog; import org.eclipse.jdt.internal.ui.dialogs.SourceActionDialog; import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.BindingLabelProvider; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateMethodAbstractAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateMethodAbstractAction.java index 3a61e0bd24..51a6b7108f 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateMethodAbstractAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateMethodAbstractAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 IBM Corporation and others. + * Copyright (c) 2008, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -72,13 +72,13 @@ import org.eclipse.jdt.internal.ui.actions.ActionUtil; import org.eclipse.jdt.internal.ui.actions.SelectionConverter; import org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter; import org.eclipse.jdt.internal.ui.dialogs.SourceActionDialog; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext; import org.eclipse.jdt.internal.ui.util.ElementValidator; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * An abstract class containing elements common for <code>GenerateHashCodeEqualsAction</code> and @@ -394,7 +394,7 @@ abstract class GenerateMethodAbstractAction extends SelectionDispatchAction { } void initialize(IType type) throws JavaModelException { - RefactoringASTParser parser= new RefactoringASTParser(ASTProvider.SHARED_AST_LEVEL); + RefactoringASTParser parser= new RefactoringASTParser(IASTSharedValues.SHARED_AST_LEVEL); fUnit= parser.parse(type.getCompilationUnit(), true); fTypeBinding= null; // type cannot be anonymous diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateToStringAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateToStringAction.java index 3922970c33..2e97a45333 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateToStringAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/GenerateToStringAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Mateusz Matela and others. + * Copyright (c) 2008, 2016 Mateusz Matela and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -49,7 +49,7 @@ import org.eclipse.jdt.internal.ui.actions.SelectionConverter; import org.eclipse.jdt.internal.ui.dialogs.GenerateToStringDialog; import org.eclipse.jdt.internal.ui.dialogs.SourceActionDialog; import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Adds method implementations for <code>{@link java.lang.Object#toString()}</code> The action opens a diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenAction.java index b93355f3c2..c9b4317d28 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -59,7 +59,7 @@ import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; import org.eclipse.jdt.internal.ui.javaeditor.JavaElementHyperlinkDetector; import org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart; -import org.eclipse.jdt.internal.ui.search.IOccurrencesFinder.OccurrenceLocation; +import org.eclipse.jdt.internal.core.manipulation.search.IOccurrencesFinder.OccurrenceLocation; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.java index 3b95bf555e..d0a293f9f5 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenSuperImplementationAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,7 +40,7 @@ import org.eclipse.jdt.internal.ui.actions.ActionUtil; import org.eclipse.jdt.internal.ui.actions.SelectionConverter; import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * The action opens a Java editor on the selected method's super implementation. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/SurroundWithTryMultiCatchAction.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/SurroundWithTryMultiCatchAction.java index ce4dc77b95..06cb0e0f33 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/SurroundWithTryMultiCatchAction.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/SurroundWithTryMultiCatchAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 IBM Corporation and others. + * Copyright (c) 2011, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,7 +25,7 @@ import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.SelectionConverter; import org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor; import org.eclipse.jdt.internal.ui.refactoring.RefactoringMessages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Action to surround a set of statements with a try/multi-catch block. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter.java index e5eb3113f7..847c504f4b 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -42,7 +42,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.jarpackager.JarPackagerMessages; import org.eclipse.jdt.internal.ui.jarpackager.JarPackagerUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Creates a JAR file for the given JAR package data. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter2.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter2.java index e827896d54..1448bb795f 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter2.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter2.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -41,7 +41,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.jarpackager.JarPackagerMessages; import org.eclipse.jdt.internal.ui.jarpackager.JarPackagerUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** * Creates a JAR file for the given JAR package data. diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter3.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter3.java index b744493013..175d92bfd4 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter3.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarWriter3.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -61,7 +61,7 @@ import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.jarpackager.JarPackagerMessages; import org.eclipse.jdt.internal.ui.jarpackager.JarPackagerUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; /** diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/java/CompletionProposalLabelProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/java/CompletionProposalLabelProvider.java index 933ef682a9..9d64dad150 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/java/CompletionProposalLabelProvider.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/java/CompletionProposalLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 IBM Corporation and others. + * Copyright (c) 2005, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -28,7 +28,7 @@ import org.eclipse.jdt.ui.JavaElementImageDescriptor; import org.eclipse.jdt.ui.JavaElementLabels; import org.eclipse.jdt.internal.ui.JavaPluginImages; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; @@ -84,15 +84,15 @@ public class CompletionProposalLabelProvider { case CompletionProposal.METHOD_REF: case CompletionProposal.CONSTRUCTOR_INVOCATION: paramList= appendUnboundedParameterList(new StyledString(), proposal).getString(); - return Strings.markJavaElementLabelLTR(paramList); + return org.eclipse.jdt.internal.core.manipulation.util.Strings.markJavaElementLabelLTR(paramList); case CompletionProposal.TYPE_REF: case CompletionProposal.JAVADOC_TYPE_REF: paramList= appendTypeParameterList(new StyledString(), proposal).getString(); - return Strings.markJavaElementLabelLTR(paramList); + return org.eclipse.jdt.internal.core.manipulation.util.Strings.markJavaElementLabelLTR(paramList); case CompletionProposal.ANONYMOUS_CLASS_DECLARATION: case CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION: paramList= appendUnboundedParameterList(new StyledString(), proposal).getString(); - return Strings.markJavaElementLabelLTR(paramList); + return org.eclipse.jdt.internal.core.manipulation.util.Strings.markJavaElementLabelLTR(paramList); default: Assert.isLegal(false); return null; // dummy @@ -294,7 +294,7 @@ public class CompletionProposalLabelProvider { declaringType= Signature.getSimpleName(declaringType); nameBuffer.append(declaringType, StyledString.QUALIFIER_STYLER); - return Strings.markJavaElementLabelLTR(nameBuffer); + return org.eclipse.jdt.internal.corext.util.Strings.markJavaElementLabelLTR(nameBuffer); } /** @@ -327,7 +327,7 @@ public class CompletionProposalLabelProvider { declaringType= Signature.getSimpleName(declaringType); nameBuffer.append(declaringType, StyledString.QUALIFIER_STYLER); - return Strings.markJavaElementLabelLTR(nameBuffer); + return org.eclipse.jdt.internal.corext.util.Strings.markJavaElementLabelLTR(nameBuffer); } StyledString createOverrideMethodProposalLabel(CompletionProposal methodProposal) { @@ -421,7 +421,7 @@ public class CompletionProposalLabelProvider { buf.append(JavaElementLabels.CONCAT_STRING, StyledString.QUALIFIER_STYLER); buf.append(new String(fullName, 0, qIndex - 1), StyledString.QUALIFIER_STYLER); } - return Strings.markJavaElementLabelLTR(buf); + return org.eclipse.jdt.internal.corext.util.Strings.markJavaElementLabelLTR(buf); } StyledString createJavadocTypeProposalLabel(char[] fullName) { @@ -436,7 +436,7 @@ public class CompletionProposalLabelProvider { buf.append(JavaElementLabels.CONCAT_STRING, StyledString.QUALIFIER_STYLER); buf.append(new String(fullName, 0, qIndex - 1), StyledString.QUALIFIER_STYLER); } - return Strings.markJavaElementLabelLTR(buf); + return org.eclipse.jdt.internal.corext.util.Strings.markJavaElementLabelLTR(buf); } private int findSimpleNameStart(char[] array) { diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/BuildPathDialogAccess.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/BuildPathDialogAccess.java index 721cfb82c2..0159c092de 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/BuildPathDialogAccess.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/BuildPathDialogAccess.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -47,7 +47,7 @@ import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.internal.ui.IUIConstants; import org.eclipse.jdt.internal.ui.JavaPlugin; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.FilteredElementTreeSelectionDialog; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewContainerWizardPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewContainerWizardPage.java index edd4b1bd0b..ea39ffe575 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewContainerWizardPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewContainerWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -58,7 +58,7 @@ import org.eclipse.jdt.ui.StandardJavaElementContentProvider; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.viewsupport.IViewPartInputProvider; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java index e9b2ce64cf..0760c5a48d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2014 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -88,7 +88,7 @@ import org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart; import org.eclipse.jdt.internal.ui.preferences.CompliancePreferencePage; import org.eclipse.jdt.internal.ui.preferences.NewJavaProjectPreferencePage; import org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport; import org.eclipse.jdt.internal.ui.wizards.dialogfields.ComboDialogField; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewPackageWizardPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewPackageWizardPage.java index 6e3cae2dc0..fbf048e34d 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewPackageWizardPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewPackageWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2013 IBM Corporation and others. + * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -71,7 +71,7 @@ import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil; import org.eclipse.jdt.internal.corext.util.JavaConventionsUtil; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaUI; diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewTypeWizardPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewTypeWizardPage.java index d5e8dd5c31..fba3e24017 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewTypeWizardPage.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/wizards/NewTypeWizardPage.java @@ -119,13 +119,14 @@ import org.eclipse.jdt.internal.corext.dom.ASTNodes; import org.eclipse.jdt.internal.corext.dom.TokenScanner; import org.eclipse.jdt.internal.corext.refactoring.StubTypeContext; import org.eclipse.jdt.internal.corext.refactoring.TypeContextChecker; +import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.template.java.JavaContext; import org.eclipse.jdt.internal.corext.util.CodeFormatterUtil; import org.eclipse.jdt.internal.corext.util.JavaConventionsUtil; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.corext.util.Messages; import org.eclipse.jdt.internal.corext.util.Resources; -import org.eclipse.jdt.internal.corext.util.Strings; +import org.eclipse.jdt.internal.core.manipulation.util.Strings; import org.eclipse.jdt.ui.CodeGeneration; import org.eclipse.jdt.ui.JavaElementLabelProvider; @@ -136,7 +137,7 @@ import org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.dialogs.TableTextCellEditor; import org.eclipse.jdt.internal.ui.dialogs.TextFieldNavigationHandler; -import org.eclipse.jdt.internal.ui.javaeditor.ASTProvider; +import org.eclipse.jdt.internal.corext.dom.IASTSharedValues; import org.eclipse.jdt.internal.ui.preferences.CodeTemplatePreferencePage; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; import org.eclipse.jdt.internal.ui.refactoring.contentassist.CompletionContextRequestor; @@ -144,7 +145,7 @@ import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssis import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaPackageCompletionProcessor; import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor; import org.eclipse.jdt.internal.ui.util.SWTUtil; -import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; +import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.SuperInterfaceSelectionDialog; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; @@ -282,7 +283,7 @@ public abstract class NewTypeWizardPage extends NewContainerWizardPage { /* package */ void create(boolean needsSave, IProgressMonitor monitor) throws CoreException { TextEdit edit= fImportsRewrite.rewriteImports(monitor); - JavaModelUtil.applyEdit(fImportsRewrite.getCompilationUnit(), edit, needsSave, null); + JavaElementUtil.applyEdit(fImportsRewrite.getCompilationUnit(), edit, needsSave, null); } /* package */ void removeImport(String qualifiedName) { @@ -1815,7 +1816,7 @@ public abstract class NewTypeWizardPage extends NewContainerWizardPage { return status; } String typeDeclaration= "class " + typeNameWithParameters + " {}"; //$NON-NLS-1$//$NON-NLS-2$ - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(typeDeclaration.toCharArray()); parser.setProject(project); CompilationUnit compilationUnit= (CompilationUnit) parser.createAST(null); @@ -2273,7 +2274,7 @@ public abstract class NewTypeWizardPage extends NewContainerWizardPage { } private CompilationUnit createASTForImports(ICompilationUnit cu) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(true); parser.setFocalPosition(0); @@ -2291,7 +2292,7 @@ public abstract class NewTypeWizardPage extends NewContainerWizardPage { } private void removeUnusedImports(ICompilationUnit cu, Set<String> existingImports, boolean needsSave) throws CoreException { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(true); @@ -2357,7 +2358,7 @@ public abstract class NewTypeWizardPage extends NewContainerWizardPage { IPackageFragment pack= (IPackageFragment) cu.getParent(); String content= CodeGeneration.getCompilationUnitContent(cu, fileComment, typeComment, typeContent, lineDelimiter); if (content != null) { - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setProject(cu.getJavaProject()); parser.setSource(content.toCharArray()); CompilationUnit unit= (CompilationUnit) parser.createAST(null); @@ -2677,7 +2678,7 @@ public abstract class NewTypeWizardPage extends NewContainerWizardPage { ArrayList<IMethod> newMethods= new ArrayList<>(); CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(type.getJavaProject()); settings.createComments= isAddComments(); - ASTParser parser= ASTParser.newParser(ASTProvider.SHARED_AST_LEVEL); + ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setResolveBindings(true); parser.setSource(cu); CompilationUnit unit= (CompilationUnit) parser.createAST(new SubProgressMonitor(monitor, 1)); |