Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 236994 Details for
Bug 407056
[1.8] Support PackageQualifiedType AST node
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch created against BETA_JAVA8 ws
eclipse.jdt.ui.v2.patch (text/plain), 25.06 KB, created by
Martin Mathew
on 2013-10-29 02:29:40 EDT
(
hide
)
Description:
Patch created against BETA_JAVA8 ws
Filename:
MIME Type:
Creator:
Martin Mathew
Created:
2013-10-29 02:29:40 EDT
Size:
25.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >diff --git core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java >index bb0950f..3a699de 100644 >--- core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java >+++ core extension/org/eclipse/jdt/internal/corext/dom/ASTNodes.java >@@ -650,8 +650,10 @@ > current= current.getParent(); > } > // normalize type >- if (QualifiedType.NAME_PROPERTY.equals(current.getLocationInParent()) || >- SimpleType.NAME_PROPERTY.equals(current.getLocationInParent())) { >+ StructuralPropertyDescriptor locationInParent= current.getLocationInParent(); >+ if (QualifiedType.NAME_PROPERTY.equals(locationInParent) || >+ SimpleType.NAME_PROPERTY.equals(locationInParent) || >+ PackageQualifiedType.NAME_PROPERTY.equals(locationInParent)) { > current= current.getParent(); > } > // normalize parameterized types >diff --git core extension/org/eclipse/jdt/internal/corext/fix/PotentialProgrammingProblemsFix.java core extension/org/eclipse/jdt/internal/corext/fix/PotentialProgrammingProblemsFix.java >index dd34f48..4c61c24 100644 >--- core extension/org/eclipse/jdt/internal/corext/fix/PotentialProgrammingProblemsFix.java >+++ core extension/org/eclipse/jdt/internal/corext/fix/PotentialProgrammingProblemsFix.java >@@ -1,9 +1,13 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2013 IBM Corporation and others. > * All rights reserved. This program and 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 >+ * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. > * > * Contributors: > * IBM Corporation - initial API and implementation >@@ -47,6 +51,7 @@ > import org.eclipse.jdt.core.dom.IBinding; > import org.eclipse.jdt.core.dom.ITypeBinding; > import org.eclipse.jdt.core.dom.Name; >+import org.eclipse.jdt.core.dom.PackageQualifiedType; > import org.eclipse.jdt.core.dom.ParameterizedType; > import org.eclipse.jdt.core.dom.QualifiedName; > import org.eclipse.jdt.core.dom.QualifiedType; >@@ -383,13 +388,16 @@ > > Name name= null; > if (selection instanceof SimpleType) { >- final SimpleType type= (SimpleType) selection; >- name= type.getName(); >+ name= ((SimpleType) selection).getName(); >+ } else if (selection instanceof PackageQualifiedType) { >+ name= ((PackageQualifiedType) selection).getName(); > } else if (selection instanceof ParameterizedType) { > final ParameterizedType type= (ParameterizedType) selection; > final Type raw= type.getType(); > if (raw instanceof SimpleType) > name= ((SimpleType) raw).getName(); >+ else if (raw instanceof PackageQualifiedType) >+ name= ((PackageQualifiedType) raw).getName(); > else if (raw instanceof QualifiedType) > name= ((QualifiedType) raw).getName(); > } else if (selection instanceof Name) { >diff --git ui/org/eclipse/jdt/internal/ui/actions/CopyQualifiedNameAction.java ui/org/eclipse/jdt/internal/ui/actions/CopyQualifiedNameAction.java >index 85e0681..80f6c5c 100644 >--- ui/org/eclipse/jdt/internal/ui/actions/CopyQualifiedNameAction.java >+++ ui/org/eclipse/jdt/internal/ui/actions/CopyQualifiedNameAction.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2013 IBM Corporation and others. > * All rights reserved. This program and 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 > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -65,6 +69,7 @@ > import org.eclipse.jdt.core.dom.Name; > import org.eclipse.jdt.core.dom.NodeFinder; > import org.eclipse.jdt.core.dom.PackageDeclaration; >+import org.eclipse.jdt.core.dom.PackageQualifiedType; > import org.eclipse.jdt.core.dom.SimpleType; > import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor; > import org.eclipse.jdt.core.dom.Type; >@@ -361,7 +366,7 @@ > */ > private IBinding getConstructorBindingIfAvailable(Name nameNode) { > StructuralPropertyDescriptor loc= nameNode.getLocationInParent(); >- if (loc == SimpleType.NAME_PROPERTY) { >+ if (loc == SimpleType.NAME_PROPERTY || loc == PackageQualifiedType.NAME_PROPERTY) { > ASTNode parent= nameNode.getParent(); > loc= parent.getLocationInParent(); > if (loc == ClassInstanceCreation.TYPE_PROPERTY) >diff --git ui/org/eclipse/jdt/internal/ui/search/OccurrencesFinder.java ui/org/eclipse/jdt/internal/ui/search/OccurrencesFinder.java >index 0e2e520..c4f6be7 100644 >--- ui/org/eclipse/jdt/internal/ui/search/OccurrencesFinder.java >+++ ui/org/eclipse/jdt/internal/ui/search/OccurrencesFinder.java >@@ -1,10 +1,14 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2011 IBM Corporation and others. >+ * Copyright (c) 2000, 2013 IBM Corporation and others. > * All rights reserved. This program and 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 > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > *******************************************************************************/ >@@ -32,6 +36,7 @@ > import org.eclipse.jdt.core.dom.Modifier; > import org.eclipse.jdt.core.dom.Name; > import org.eclipse.jdt.core.dom.NodeFinder; >+import org.eclipse.jdt.core.dom.PackageQualifiedType; > import org.eclipse.jdt.core.dom.ParameterizedType; > import org.eclipse.jdt.core.dom.PostfixExpression; > import org.eclipse.jdt.core.dom.PrefixExpression; >@@ -187,6 +192,9 @@ > if (name instanceof QualifiedName) > name= ((QualifiedName)name).getName(); > addUsage(name, node.resolveConstructorBinding()); >+ } else if (type instanceof PackageQualifiedType) { >+ Name name= ((PackageQualifiedType) type).getName(); >+ addUsage(name, node.resolveConstructorBinding()); > } > return super.visit(node); > } >diff --git ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java >index d0c15f6..b80f55c 100644 >--- ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java >+++ ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java >@@ -59,6 +59,7 @@ > 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.PackageQualifiedType; > import org.eclipse.jdt.core.dom.ParameterizedType; > import org.eclipse.jdt.core.dom.PrefixExpression; > import org.eclipse.jdt.core.dom.PrimitiveType; >@@ -407,7 +408,8 @@ > if (locationInParent == QualifiedName.QUALIFIER_PROPERTY) { > return null; // can't guess type for X.A > } >- if (locationInParent == SimpleType.NAME_PROPERTY) { >+ if (locationInParent == SimpleType.NAME_PROPERTY || >+ locationInParent == PackageQualifiedType.NAME_PROPERTY) { > node= node.getParent(); > } > ITypeBinding binding= Bindings.normalizeTypeBinding(getPossibleTypeBinding(node)); >diff --git ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java >index cd9e66e..00f1bb4 100644 >--- ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java >+++ ui/org/eclipse/jdt/internal/ui/text/correction/LocalCorrectionsSubProcessor.java >@@ -80,6 +80,7 @@ > 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.PackageQualifiedType; > import org.eclipse.jdt.core.dom.ParameterizedType; > import org.eclipse.jdt.core.dom.ParenthesizedExpression; > import org.eclipse.jdt.core.dom.PrefixExpression; >@@ -1436,10 +1437,14 @@ > Name node= null; > if (selectedNode instanceof SimpleType) { > node= ((SimpleType) selectedNode).getName(); >+ } else if (selectedNode instanceof PackageQualifiedType) { >+ node= ((PackageQualifiedType) selectedNode).getName(); > } else if (selectedNode instanceof ArrayType) { > Type elementType= ((ArrayType) selectedNode).getElementType(); > if (elementType.isSimpleType()) { > node= ((SimpleType) elementType).getName(); >+ } else if (elementType.isPackageQualifiedType()) { >+ node= ((PackageQualifiedType) elementType).getName(); > } else { > return; > } >@@ -1463,7 +1468,7 @@ > simpleBinding= simpleBinding.getTypeDeclaration(); > > if (!simpleBinding.isRecovered()) { >- if (binding.isParameterizedType() && node.getParent() instanceof SimpleType && !(node.getParent().getParent() instanceof Type)) { >+ if (binding.isParameterizedType() && (node.getParent() instanceof SimpleType || node.getParent() instanceof PackageQualifiedType) && !(node.getParent().getParent() instanceof Type)) { > proposals.add(UnresolvedElementsSubProcessor.createTypeRefChangeFullProposal(cu, binding, node, IProposalRelevance.TYPE_ARGUMENTS_FROM_CONTEXT)); > } > } >diff --git ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java >index a2a7eb1..c743e70 100644 >--- ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java >+++ ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Benjamin Muskalla <bmuskalla@innoopract.com> - [quick fix] 'Remove invalid modifiers' does not appear for enums and annotations - https://bugs.eclipse.org/bugs/show_bug.cgi?id=110589 >@@ -54,6 +58,7 @@ > 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.PackageQualifiedType; > import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword; > import org.eclipse.jdt.core.dom.QualifiedName; > import org.eclipse.jdt.core.dom.ReturnStatement; >@@ -127,6 +132,9 @@ > case ASTNode.SIMPLE_TYPE: > binding= ((SimpleType) selectedNode).resolveBinding(); > break; >+ case ASTNode.PACKAGE_QUALIFIED_TYPE: >+ binding= ((PackageQualifiedType) selectedNode).resolveBinding(); >+ break; > case ASTNode.METHOD_INVOCATION: > binding= ((MethodInvocation) selectedNode).getName().resolveBinding(); > break; >diff --git ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java >index 2622fd3..cefa41b 100644 >--- ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java >+++ ui/org/eclipse/jdt/internal/ui/text/correction/QuickAssistProcessor.java >@@ -82,6 +82,7 @@ > import org.eclipse.jdt.core.dom.Modifier; > import org.eclipse.jdt.core.dom.Name; > import org.eclipse.jdt.core.dom.NumberLiteral; >+import org.eclipse.jdt.core.dom.PackageQualifiedType; > import org.eclipse.jdt.core.dom.ParameterizedType; > import org.eclipse.jdt.core.dom.ParenthesizedExpression; > import org.eclipse.jdt.core.dom.PostfixExpression; >@@ -505,8 +506,9 @@ > > if (node instanceof Name) { > Name name= ASTNodes.getTopMostName((Name) node); >- if (name.getLocationInParent() == SimpleType.NAME_PROPERTY) { >- SimpleType type= (SimpleType) name.getParent(); >+ if (name.getLocationInParent() == SimpleType.NAME_PROPERTY || >+ name.getLocationInParent() == PackageQualifiedType.NAME_PROPERTY) { >+ ASTNode type= name.getParent(); > if (type.getLocationInParent() == ParameterizedType.TYPE_PROPERTY) { > createdType= (ParameterizedType) type.getParent(); > if (createdType.getLocationInParent() != ClassInstanceCreation.TYPE_PROPERTY) { >@@ -1275,7 +1277,7 @@ > } > > Type type= catchClause.getException().getType(); >- if (!type.isSimpleType() && !type.isUnionType()) { >+ if (!type.isSimpleType() && !type.isUnionType() && !type.isPackageQualifiedType()) { > return false; > } > >@@ -1291,12 +1293,14 @@ > AST ast= bodyDeclaration.getAST(); > Image image= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_EXCEPTION); > >- SimpleType selectedMultiCatchType= null; >+ Type selectedMultiCatchType= null; > if (type.isUnionType() && node instanceof Name) { > Name topMostName= ASTNodes.getTopMostName((Name) node); > ASTNode parent= topMostName.getParent(); > if (parent instanceof SimpleType) { > selectedMultiCatchType= (SimpleType) parent; >+ } else if (parent instanceof PackageQualifiedType) { >+ selectedMultiCatchType= (PackageQualifiedType) parent; > } > } > >@@ -1316,12 +1320,12 @@ > UnionType unionType= (UnionType) type; > List<Type> types= unionType.types(); > for (Type elementType : types) { >- if (!(elementType instanceof SimpleType)) >+ if (!(elementType instanceof SimpleType || elementType instanceof PackageQualifiedType)) > return false; >- addExceptionToThrows(ast, methodDeclaration, rewrite, (SimpleType) elementType); >+ addExceptionToThrows(ast, methodDeclaration, rewrite, elementType); > } > } else { >- addExceptionToThrows(ast, methodDeclaration, rewrite, (SimpleType) type); >+ addExceptionToThrows(ast, methodDeclaration, rewrite, type); > } > String label= CorrectionMessages.QuickAssistProcessor_catchclausetothrows_description; > ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, IProposalRelevance.REPLACE_CATCH_CLAUSE_WITH_THROWS, image); >@@ -1357,7 +1361,7 @@ > } > } > >- private static void addExceptionToThrows(AST ast, MethodDeclaration methodDeclaration, ASTRewrite rewrite, SimpleType type2) { >+ private static void addExceptionToThrows(AST ast, MethodDeclaration methodDeclaration, ASTRewrite rewrite, Type type2) { > ITypeBinding binding= type2.resolveBinding(); > if (binding == null || isNotYetThrown(binding, methodDeclaration.thrownExceptionTypes())) { > Type newType= (Type) ASTNode.copySubtree(ast, type2); >@@ -1424,12 +1428,12 @@ > return false; > } > >- SimpleType selectedMultiCatchType= null; >+ Type selectedMultiCatchType= null; > if (type.isUnionType() && node instanceof Name) { > Name topMostName= ASTNodes.getTopMostName((Name) node); > ASTNode parent= topMostName.getParent(); >- if (parent instanceof SimpleType) { >- selectedMultiCatchType= (SimpleType) parent; >+ if (parent instanceof SimpleType || parent instanceof PackageQualifiedType) { >+ selectedMultiCatchType= (Type) parent; > } > } > >@@ -1497,12 +1501,12 @@ > } > > Type type1= catchClause.getException().getType(); >- SimpleType selectedMultiCatchType= null; >+ Type selectedMultiCatchType= null; > if (type1.isUnionType() && covering instanceof Name) { > Name topMostName= ASTNodes.getTopMostName((Name) covering); > ASTNode parent= topMostName.getParent(); >- if (parent instanceof SimpleType) { >- selectedMultiCatchType= (SimpleType) parent; >+ if (parent instanceof SimpleType || parent instanceof PackageQualifiedType) { >+ selectedMultiCatchType= (Type) parent; > } > } > if (selectedMultiCatchType != null) >@@ -1588,12 +1592,12 @@ > } > > Type type1= catchClause.getException().getType(); >- SimpleType selectedMultiCatchType= null; >+ Type selectedMultiCatchType= null; > if (type1.isUnionType() && covering instanceof Name) { > Name topMostName= ASTNodes.getTopMostName((Name) covering); > ASTNode parent= topMostName.getParent(); >- if (parent instanceof SimpleType) { >- selectedMultiCatchType= (SimpleType) parent; >+ if (parent instanceof SimpleType || parent instanceof PackageQualifiedType) { >+ selectedMultiCatchType= (Type) parent; > } > } > if (selectedMultiCatchType != null) >diff --git ui/org/eclipse/jdt/internal/ui/text/correction/TypeMismatchSubProcessor.java ui/org/eclipse/jdt/internal/ui/text/correction/TypeMismatchSubProcessor.java >index f904ad5..65cbef7 100644 >--- ui/org/eclipse/jdt/internal/ui/text/correction/TypeMismatchSubProcessor.java >+++ ui/org/eclipse/jdt/internal/ui/text/correction/TypeMismatchSubProcessor.java >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [quick fix] proposes wrong cast from Object to primitive int - https://bugs.eclipse.org/bugs/show_bug.cgi?id=100593 >@@ -39,6 +43,7 @@ > import org.eclipse.jdt.core.dom.MemberValuePair; > import org.eclipse.jdt.core.dom.MethodDeclaration; > import org.eclipse.jdt.core.dom.Name; >+import org.eclipse.jdt.core.dom.PackageQualifiedType; > import org.eclipse.jdt.core.dom.SimpleName; > import org.eclipse.jdt.core.dom.SimpleType; > import org.eclipse.jdt.core.dom.SingleMemberAnnotation; >@@ -455,16 +460,22 @@ > SingleVariableDeclaration parameter= forStatement.getParameter(); > > ICompilationUnit cu= context.getCompilationUnit(); >- if (parameter.getName().getLength() == 0 >- && parameter.getType() instanceof SimpleType) { >- SimpleType type= (SimpleType) parameter.getType(); >- if (type.getName() instanceof SimpleName) { >- SimpleName simpleName= (SimpleName) type.getName(); >+ if (parameter.getName().getLength() == 0) { >+ SimpleName simpleName= null; >+ if (parameter.getType() instanceof SimpleType) { >+ SimpleType type= (SimpleType) parameter.getType(); >+ if (type.getName() instanceof SimpleName) { >+ simpleName= (SimpleName) type.getName(); >+ } >+ } else if (parameter.getType() instanceof PackageQualifiedType) { >+ simpleName= ((PackageQualifiedType) parameter.getType()).getName(); >+ } >+ if (simpleName != null) { > String name= simpleName.getIdentifier(); > int relevance= StubUtility.hasLocalVariableName(cu.getJavaProject(), name) ? 10 : 7; > String label= Messages.format(CorrectionMessages.TypeMismatchSubProcessor_create_loop_variable_description, BasicElementLabels.getJavaElementName(name)); > Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LOCAL); >- >+ > proposals.add(new NewVariableCorrectionProposal(label, cu, NewVariableCorrectionProposal.LOCAL, simpleName, null, relevance, image)); > return; > } >diff --git ui/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java ui/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java >index 2dcf18c..84b47c3 100644 >--- ui/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java >+++ ui/org/eclipse/jdt/internal/ui/text/correction/UnresolvedElementsSubProcessor.java >@@ -5,6 +5,10 @@ > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * >+ * This is an implementation of an early-draft specification developed under the Java >+ * Community Process (JCP) and is made available for testing and evaluation purposes >+ * only. The code is not compatible with any specification of the JCP. >+ * > * Contributors: > * IBM Corporation - initial API and implementation > * Renaud Waldura <renaud+eclipse@waldura.com> - New class/interface with wizard >@@ -96,6 +100,7 @@ > import org.eclipse.jdt.core.dom.Modifier; > import org.eclipse.jdt.core.dom.Name; > import org.eclipse.jdt.core.dom.NormalAnnotation; >+import org.eclipse.jdt.core.dom.PackageQualifiedType; > import org.eclipse.jdt.core.dom.ParenthesizedExpression; > import org.eclipse.jdt.core.dom.QualifiedName; > import org.eclipse.jdt.core.dom.SimpleName; >@@ -211,7 +216,7 @@ > node= null; > } > } >- } else if (parent instanceof SimpleType) { >+ } else if (parent instanceof SimpleType || parent instanceof PackageQualifiedType) { > suggestVariableProposals= false; > typeKind= SimilarElementsRequestor.REF_TYPES_AND_VAR; > } else if (parent instanceof QualifiedName) { >@@ -225,7 +230,7 @@ > while (outerParent instanceof QualifiedName) { > outerParent= outerParent.getParent(); > } >- if (outerParent instanceof SimpleType) { >+ if (outerParent instanceof SimpleType || outerParent instanceof PackageQualifiedType) { > typeKind= SimilarElementsRequestor.REF_TYPES; > suggestVariableProposals= false; > } >@@ -249,7 +254,7 @@ > typeKind= SimilarElementsRequestor.REF_TYPES; > suggestVariableProposals= node.isSimpleName(); > } >- if (selectedNode.getParent() instanceof SimpleType) { >+ if (selectedNode.getParent() instanceof SimpleType || selectedNode.getParent() instanceof PackageQualifiedType) { > typeKind= SimilarElementsRequestor.REF_TYPES; > suggestVariableProposals= false; > } >@@ -609,10 +614,14 @@ > Name node= null; > if (selectedNode instanceof SimpleType) { > node= ((SimpleType) selectedNode).getName(); >+ } else if (selectedNode instanceof PackageQualifiedType) { >+ node= ((PackageQualifiedType) selectedNode).getName(); > } else if (selectedNode instanceof ArrayType) { > Type elementType= ((ArrayType) selectedNode).getElementType(); > if (elementType.isSimpleType()) { > node= ((SimpleType) elementType).getName(); >+ } else if (elementType.isPackageQualifiedType()) { >+ node= ((PackageQualifiedType) elementType).getName(); > } else { > return; > } >@@ -641,7 +650,7 @@ > } > > private static void addEnhancedForWithoutTypeProposals(ICompilationUnit cu, ASTNode selectedNode, Collection<ICommandAccess> proposals) { >- if (selectedNode instanceof SimpleName && selectedNode.getLocationInParent() == SimpleType.NAME_PROPERTY) { >+ if (selectedNode instanceof SimpleName && (selectedNode.getLocationInParent() == SimpleType.NAME_PROPERTY || selectedNode.getLocationInParent() == PackageQualifiedType.NAME_PROPERTY)) { > ASTNode type= selectedNode.getParent(); > if (type.getLocationInParent() == SingleVariableDeclaration.TYPE_PROPERTY) { > SingleVariableDeclaration svd= (SingleVariableDeclaration) type.getParent(); >@@ -840,7 +849,7 @@ > if (proposal instanceof AddImportCorrectionProposal) > proposal.setRelevance(relevance + elements.length + 2); > >- if (binding.isParameterizedType() && node.getParent() instanceof SimpleType && !(node.getParent().getParent() instanceof Type)) { >+ if (binding.isParameterizedType() && (node.getParent() instanceof SimpleType || node.getParent() instanceof PackageQualifiedType) && !(node.getParent().getParent() instanceof Type)) { > proposals.add(createTypeRefChangeFullProposal(cu, binding, node, relevance + 5)); > } > } >diff --git ui/org/eclipse/jdt/internal/ui/text/java/hover/JavadocHover.java ui/org/eclipse/jdt/internal/ui/text/java/hover/JavadocHover.java >index b0e49f9..8c6c54b 100644 >--- ui/org/eclipse/jdt/internal/ui/text/java/hover/JavadocHover.java >+++ ui/org/eclipse/jdt/internal/ui/text/java/hover/JavadocHover.java >@@ -84,6 +84,7 @@ > import org.eclipse.jdt.core.dom.ITypeBinding; > import org.eclipse.jdt.core.dom.IVariableBinding; > import org.eclipse.jdt.core.dom.NodeFinder; >+import org.eclipse.jdt.core.dom.PackageQualifiedType; > import org.eclipse.jdt.core.dom.ParameterizedType; > import org.eclipse.jdt.core.dom.QualifiedName; > import org.eclipse.jdt.core.dom.QualifiedType; >@@ -1042,7 +1043,9 @@ > // workaround for https://bugs.eclipse.org/62605 (constructor name resolves to type, not method) > SimpleName simpleName= (SimpleName) node; > StructuralPropertyDescriptor loc= simpleName.getLocationInParent(); >- while (loc == QualifiedType.NAME_PROPERTY || loc == QualifiedName.NAME_PROPERTY|| loc == SimpleType.NAME_PROPERTY || loc == ParameterizedType.TYPE_PROPERTY) { >+ while (loc == QualifiedType.NAME_PROPERTY || loc == QualifiedName.NAME_PROPERTY >+ || loc == SimpleType.NAME_PROPERTY || loc == PackageQualifiedType.NAME_PROPERTY >+ || loc == ParameterizedType.TYPE_PROPERTY) { > node= node.getParent(); > loc= node.getLocationInParent(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 407056
:
232819
|
236994
|
238708