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 73530 Details for
Bug 196147
[Algorithm] Text compare viewer splits insertion into two changes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
SuperTypeConstraintsCreator.txt
SuperTypeConstraintsCreator.txt (text/plain), 3.36 KB, created by
Markus Keller
on 2007-07-11 08:57:39 EDT
(
hide
)
Description:
SuperTypeConstraintsCreator.txt
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2007-07-11 08:57:39 EDT
Size:
3.36 KB
patch
obsolete
>package org.eclipse.jdt.internal.corext.refactoring.structure.constraints; > >import org.eclipse.jdt.core.dom.CastExpression; >import org.eclipse.jdt.core.dom.CatchClause; >import org.eclipse.jdt.core.dom.ClassInstanceCreation; >import org.eclipse.jdt.core.dom.Comment; >import org.eclipse.jdt.core.dom.ConditionalExpression; >import org.eclipse.jdt.core.dom.ConstructorInvocation; >import org.eclipse.jdt.core.dom.Expression; > >/** > * Type constraints creator to determine the necessary constraints to replace type occurrences by a given super type. > * > * @since 3.1 > */ >public final class SuperTypeConstraintsCreator extends HierarchicalASTVisitor { > > /* > * @see org.eclipse.jdt.internal.corext.dom.HierarchicalASTVisitor#endVisit(org.eclipse.jdt.core.dom.ArrayType) > */ > public final void endVisit(final ArrayType node) { > ArrayType array= null; > Type component= node.getComponentType(); > while (component instanceof ArrayType) { > array= (ArrayType) component; > component= array.getComponentType(); > } > final ConstraintVariable2 variable= fModel.createTypeVariable(component); > if (variable != null) { > component.setProperty(PROPERTY_CONSTRAINT_VARIABLE, variable); > node.setProperty(PROPERTY_CONSTRAINT_VARIABLE, variable); > } > } > > /* > * @see org.eclipse.jdt.internal.corext.dom.HierarchicalASTVisitor#endVisit(org.eclipse.jdt.core.dom.SimpleName) > */ > public final void endVisit(final SimpleName node) { > final ASTNode parent= node.getParent(); > if (!(parent instanceof ImportDeclaration) && !(parent instanceof PackageDeclaration) && !(parent instanceof AbstractTypeDeclaration)) { > final IBinding binding= node.resolveBinding(); > if (binding instanceof IVariableBinding && !(parent instanceof MethodDeclaration)) > endVisit((IVariableBinding) binding, null, node); > else if (binding instanceof ITypeBinding && parent instanceof MethodDeclaration) > endVisit((ITypeBinding) binding, node); > } > } > > /* > * @see org.eclipse.jdt.internal.corext.dom.HierarchicalASTVisitor#endVisit(org.eclipse.jdt.core.dom.SingleVariableDeclaration) > */ > public final void endVisit(final SingleVariableDeclaration node) { > final ConstraintVariable2 ancestor= (ConstraintVariable2) node.getType().getProperty(PROPERTY_CONSTRAINT_VARIABLE); > if (ancestor != null) { > node.setProperty(PROPERTY_CONSTRAINT_VARIABLE, ancestor); > final Expression expression= node.getInitializer(); > if (expression != null) { > final ConstraintVariable2 descendant= (ConstraintVariable2) expression.getProperty(PROPERTY_CONSTRAINT_VARIABLE); > if (descendant != null) > fModel.createSubtypeConstraint(descendant, ancestor); > } > } > } > > /* > * @see org.eclipse.jdt.internal.corext.dom.HierarchicalASTVisitor#endVisit(org.eclipse.jdt.core.dom.SuperConstructorInvocation) > */ > public final void endVisit(final SuperConstructorInvocation node) { > final IMethodBinding binding= node.resolveConstructorBinding(); > if (binding != null) > endVisit(node.arguments(), binding); > } > > /* > * @see org.eclipse.jdt.internal.corext.dom.HierarchicalASTVisitor#endVisit(org.eclipse.jdt.core.dom.SuperFieldAccess) > */ > public final void endVisit(final SuperFieldAccess node) { > final Name name= node.getName(); > final IBinding binding= name.resolveBinding(); > if (binding instanceof IVariableBinding) > endVisit((IVariableBinding) binding, null, node); > } > >}
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 Raw
Actions:
View
Attachments on
bug 196147
:
73529
| 73530