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 112408 Details for
Bug 53024
[DOM] Move NodeFinder to a non-internal package
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
add boolean ASTVisitor#preVisit2(ASTNode)
53024_patch.txt (text/plain), 4.37 KB, created by
Markus Keller
on 2008-09-12 08:34:25 EDT
(
hide
)
Description:
add boolean ASTVisitor#preVisit2(ASTNode)
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2008-09-12 08:34:25 EDT
Size:
4.37 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: dom/org/eclipse/jdt/core/dom/ASTNode.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java,v >retrieving revision 1.77 >diff -u -r1.77 ASTNode.java >--- dom/org/eclipse/jdt/core/dom/ASTNode.java 27 Jun 2008 16:03:49 -0000 1.77 >+++ dom/org/eclipse/jdt/core/dom/ASTNode.java 12 Sep 2008 12:26:22 -0000 >@@ -2473,9 +2473,10 @@ > throw new IllegalArgumentException(); > } > // begin with the generic pre-visit >- visitor.preVisit(this); >- // dynamic dispatch to internal method for type-specific visit/endVisit >- accept0(visitor); >+ if (visitor.preVisit2(this)) { >+ // dynamic dispatch to internal method for type-specific visit/endVisit >+ accept0(visitor); >+ } > // end with the generic post-visit > visitor.postVisit(this); > } >Index: dom/org/eclipse/jdt/core/dom/ASTVisitor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java,v >retrieving revision 1.24 >diff -u -r1.24 ASTVisitor.java >--- dom/org/eclipse/jdt/core/dom/ASTVisitor.java 27 Jun 2008 16:03:45 -0000 1.24 >+++ dom/org/eclipse/jdt/core/dom/ASTVisitor.java 12 Sep 2008 12:26:22 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * Copyright (c) 2000, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -143,12 +143,32 @@ > * </p> > * > * @param node the node to visit >+ * >+ * @see #preVisit2(ASTNode) > */ > public void preVisit(ASTNode node) { > // default implementation: do nothing > } > > /** >+ * Visits the given AST node prior to the type-specific visit. (before <code>visit</code>). >+ * <p> >+ * The default implementation calls {@link #preVisit(ASTNode)} and then >+ * returns true. Subclasses may reimplement. >+ * </p> >+ * >+ * @param node the node to visit >+ * @return <code>true</code> if <code>visit(node)</code> should be called, >+ * and <code>false</code> if the children of this node should be skipped >+ * @see #preVisit(ASTNode) >+ * @since 3.5 >+ */ >+ public boolean preVisit2(ASTNode node) { >+ preVisit(node); >+ return true; >+ } >+ >+ /** > * Visits the given AST node following the type-specific visit > * (after <code>endVisit</code>). > * <p> >#P org.eclipse.jdt.ui >Index: core extension/org/eclipse/jdt/internal/corext/dom/NodeFinder.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/NodeFinder.java,v >retrieving revision 1.17 >diff -u -r1.17 NodeFinder.java >--- core extension/org/eclipse/jdt/internal/corext/dom/NodeFinder.java 11 Sep 2008 11:59:38 -0000 1.17 >+++ core extension/org/eclipse/jdt/internal/corext/dom/NodeFinder.java 12 Sep 2008 12:26:23 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2007 IBM Corporation and others. >+ * Copyright (c) 2000, 2008 IBM Corporation and others. > * All rights reserved. This program and 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,12 +19,13 @@ > import org.eclipse.jdt.core.compiler.ITerminalSymbols; > import org.eclipse.jdt.core.compiler.InvalidInputException; > import org.eclipse.jdt.core.dom.ASTNode; >+import org.eclipse.jdt.core.dom.ASTVisitor; > /** > * For a give range finds the node covered and the node covering. > * > * @since 2.1 > */ >-public class NodeFinder extends GenericVisitor { >+public class NodeFinder extends ASTVisitor { > > /** > * A visitor that maps a selection to a given ASTNode. The result node is >@@ -127,7 +128,7 @@ > fEnd= offset + length; > } > >- protected boolean visitNode(ASTNode node) { >+ public boolean preVisit2(ASTNode node) { > int nodeStart= node.getStartPosition(); > int nodeEnd= nodeStart + node.getLength(); > if (nodeEnd < fStart || fEnd < nodeStart) {
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 53024
:
112408
|
115071
|
115150
|
148752