diff options
author | Markus Schorn | 2010-08-27 09:01:29 +0000 |
---|---|---|
committer | Markus Schorn | 2010-08-27 09:01:29 +0000 |
commit | c31e996fc2028a85d4b2794e2a288285ed8e6807 (patch) | |
tree | 0e0869f52b2c78f5b26ac7b1bcfc48ad546fa247 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java | |
parent | d3fcfea8f14545f4d418d6824b4b2b99fd7647be (diff) | |
download | org.eclipse.cdt-c31e996fc2028a85d4b2794e2a288285ed8e6807.tar.gz org.eclipse.cdt-c31e996fc2028a85d4b2794e2a288285ed8e6807.tar.xz org.eclipse.cdt-c31e996fc2028a85d4b2794e2a288285ed8e6807.zip |
Bug 323723: Reduce usage of DOMExceptions.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java')
-rw-r--r-- | core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java | 71 |
1 files changed, 12 insertions, 59 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java index b79811985df..7070db72482 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java @@ -61,63 +61,19 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt public CPPFunctionProblem(IASTNode node, int id, char[] arg) { super(node, id, arg); } - - public ICPPParameter[] getParameters() throws DOMException { - throw new DOMException(this); - } - - public IScope getFunctionScope() throws DOMException { - throw new DOMException(this); - } - - public ICPPFunctionType getType() throws DOMException { - throw new DOMException(this); - } - public boolean isStatic() throws DOMException { - throw new DOMException(this); - } - public String[] getQualifiedName() throws DOMException { - throw new DOMException(this); - } - public char[][] getQualifiedNameCharArray() throws DOMException { - throw new DOMException(this); - } - public boolean isGloballyQualified() throws DOMException { - throw new DOMException(this); - } - public boolean isDeleted() { - return false; - } - public boolean isMutable() throws DOMException { - throw new DOMException(this); - } - public boolean isInline() throws DOMException { - throw new DOMException(this); - } - public boolean isExternC() throws DOMException { - throw new DOMException(this); - } - public boolean isExtern() throws DOMException { + @Override + public ICPPFunctionType getType() throws DOMException { throw new DOMException(this); } - public boolean isAuto() throws DOMException { - throw new DOMException(this); - } - public boolean isRegister() throws DOMException { + public ICPPParameter[] getParameters() throws DOMException { throw new DOMException(this); } - public boolean takesVarArgs() throws DOMException { + public IScope getFunctionScope() throws DOMException { throw new DOMException(this); } - public IType[] getExceptionSpecification() throws DOMException { - throw new DOMException(this); - } public int getRequiredArgumentCount() throws DOMException { throw new DOMException(this); } - public boolean hasParameterPack() { - return false; - } public boolean hasSameFunctionParameterTypeList(ICPPFunction function) { return false; } @@ -158,13 +114,10 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt } else { //implicit binding IScope scope = getScope(); - try { - IASTNode node = ASTInternal.getPhysicalNodeOfScope(scope); - if (node != null) { - tu = node.getTranslationUnit(); - } - } catch (DOMException e) { - } + IASTNode node = ASTInternal.getPhysicalNodeOfScope(scope); + if (node != null) { + tu = node.getTranslationUnit(); + } } if (tu != null) { CPPVisitor.getDeclarations(tu, this); @@ -493,7 +446,7 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt return false; } - public boolean isInline() throws DOMException { + public boolean isInline() { IASTDeclarator dtor = getDefinition(); IASTDeclarator[] ds = getDeclarations(); int i = -1; @@ -520,7 +473,7 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt return false; } - public boolean isExternC() throws DOMException { + public boolean isExternC() { if (CPPVisitor.isExternC(getDefinition())) { return true; } @@ -565,11 +518,11 @@ public class CPPFunction extends PlatformObject implements ICPPFunction, ICPPInt return result.toString(); } - public IBinding getOwner() throws DOMException { + public IBinding getOwner() { return CPPVisitor.findNameOwner(getASTName(), false); } - public IType[] getExceptionSpecification() throws DOMException { + public IType[] getExceptionSpecification() { ICPPASTFunctionDeclarator declarator = getPreferredDtor(); if (declarator != null) { IASTTypeId[] astTypeIds= declarator.getExceptionSpecification(); |