From e091732356ee050ecc494ff4e62cacababe2bb1e Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Fri, 10 Jul 2015 16:28:27 -0700 Subject: [PATCH] Minor API improvement. Change-Id: Ie0b6ab44139c080dc5200c0a9c01cca0bbb9ca04 --- .../core/dom/ast/cpp/ICPPASTTranslationUnit.java | 14 +++++++++----- .../core/dom/parser/cpp/CPPASTTranslationUnit.java | 10 +++++++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTTranslationUnit.java index 2c8c4a3a725..1bc06662816 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTTranslationUnit.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTTranslationUnit.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 IBM Corporation and others. + * Copyright (c) 2004, 2015 IBM Corporation and others. * All rights reserved. This program and 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,15 +18,19 @@ import org.eclipse.cdt.core.dom.ast.IBinding; * @noimplement This interface is not intended to be implemented by clients. */ public interface ICPPASTTranslationUnit extends IASTTranslationUnit { + /** + * Returns the global namespace of the translation unit. + * + * @since 5.11 + */ + public ICPPNamespace getGlobalNamespace(); /** - * Resolve the binding for translation unit. - * - * @return IBinding + * @deprecated Use {@link #getGlobalNamespace()} */ + @Deprecated public IBinding resolveBinding(); - /** * @since 5.1 */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java index 720a9db4148..58f8062dae0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java @@ -139,14 +139,18 @@ public class CPPASTTranslationUnit extends ASTTranslationUnit implements ICPPAST } @Override - public IBinding resolveBinding() { + public ICPPNamespace getGlobalNamespace() { if (fBinding == null) fBinding = new CPPNamespace(this); return fBinding; } - @Override - @Deprecated + @Override @Deprecated + public IBinding resolveBinding() { + return getGlobalNamespace(); + } + + @Override @Deprecated public ParserLanguage getParserLanguage() { return ParserLanguage.CPP; }