diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/BTree.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/BTree.java index 0e64d1094f6..41908cf4559 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/BTree.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/BTree.java @@ -539,7 +539,7 @@ public class BTree { if (node == 0) { return true; } - visitor.preNode(node); + visitor.preVisit(node); try { Chunk chunk = db.getChunk(node); @@ -585,7 +585,7 @@ public class BTree { } return accept(getChild(chunk, node, i), visitor); } finally { - visitor.postNode(node); + visitor.postVisit(node); } } @@ -614,14 +614,14 @@ public class BTree { public String getMsg() { return msg; } public boolean isValid() { return valid; } @Override - public void postNode(long node) throws CoreException { depth--; } + public void postVisit(long node) throws CoreException { depth--; } @Override public int compare(long record) throws CoreException { return 0; } @Override public boolean visit(long record) throws CoreException { return true; } @Override - public void preNode(long node) throws CoreException { + public void preVisit(long node) throws CoreException { depth++; // Collect information for checking. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/IBTreeVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/IBTreeVisitor.java index a9002b38e37..2312513c74a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/IBTreeVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/db/IBTreeVisitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2015 QNX Software Systems and others. + * Copyright (c) 2005, 2016 QNX Software Systems and others. * All rights reserved. This program and 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,6 +8,7 @@ * Contributors: * QNX - Initial API and implementation * Markus Schorn (Wind River Systems) + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.internal.core.pdom.db; @@ -24,7 +25,7 @@ public interface IBTreeVisitor { * compatible with the one used for the B-tree. * Used for visiting. * - * @param record + * @param record the offset of the record to compare with the key * @return -1 if record < key, 0 if record == key, 1 if record > key */ public int compare(long record) throws CoreException; @@ -32,21 +33,22 @@ public interface IBTreeVisitor { /** * Visits a given record and returns whether to continue or not. * + * @param record the offset of the record being visited * @return {@code true} to continue the visit, {@code false} to abort it. */ public boolean visit(long record) throws CoreException; /** - * Called before visiting a node. + * Called before visiting a record. * - * @param record the node being visited + * @param record the offset of the record being visited */ - public default void preNode(long record) throws CoreException {} + public default void preVisit(long record) throws CoreException {} /** - * Called after visiting a node. + * Called after visiting a record. * - * @param record the node being visited + * @param record the offset of the record being visited */ - public default void postNode(long record) throws CoreException {} + public default void postVisit(long record) throws CoreException {} }