Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2010-08-27 05:01:29 -0400
committerMarkus Schorn2010-08-27 05:01:29 -0400
commitc31e996fc2028a85d4b2794e2a288285ed8e6807 (patch)
tree0e0869f52b2c78f5b26ac7b1bcfc48ad546fa247
parentd3fcfea8f14545f4d418d6824b4b2b99fd7647be (diff)
downloadorg.eclipse.cdt-c31e996fc2028a85d4b2794e2a288285ed8e6807.tar.gz
org.eclipse.cdt-c31e996fc2028a85d4b2794e2a288285ed8e6807.tar.xz
org.eclipse.cdt-c31e996fc2028a85d4b2794e2a288285ed8e6807.zip
Bug 323723: Reduce usage of DOMExceptions.
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java3
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java2
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java30
-rw-r--r--core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java105
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CElementBaseLabels.java3
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java20
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FieldHandle.java12
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionDeclarationHandle.java11
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java16
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/VariableHandle.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java10
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBinding.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ICompositeType.java15
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IField.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunction.java17
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ILabel.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java19
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IVariable.java10
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICCompositeTypeScope.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPBase.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassScope.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassTemplatePartialSpecialization.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java26
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPConstructor.java7
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPFunction.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMember.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMethod.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPNamespace.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPVariable.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexBinding.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArraySet.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectMap.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectSet.java7
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTInternal.java21
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/IASTInternalScope.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java103
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTElaboratedTypeSpecifier.java25
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTName.java29
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CBuiltinVariable.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CEnumeration.java3
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CEnumerator.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CField.java35
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunction.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunctionScope.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CKnRParameter.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CLabel.java86
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CParameter.java219
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructure.java188
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CTypedef.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVariable.java185
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java215
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/ICInternalBinding.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/AbstractCPPClassSpecializationScope.java36
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTBaseSpecifier.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTName.java37
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTNamespaceDefinition.java7
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java58
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBaseClause.java47
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBlockScope.java17
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBuiltinVariable.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassInstance.java7
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java69
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java30
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java94
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPCompositeBinding.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructor.java22
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorInstance.java3
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorSpecialization.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorTemplate.java18
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorTemplateSpecialization.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredClassInstance.java10
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumeration.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumerator.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPField.java40
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java18
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunction.java71
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java18
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java49
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitMethod.java15
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPLabel.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java40
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodInstance.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodSpecialization.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplate.java27
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplateSpecialization.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java41
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceAlias.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceScope.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameter.java42
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterSpecialization.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScope.java27
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java16
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameter.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateScope.java7
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java18
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java18
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClassInstance.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownConstructor.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownFunction.java24
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownScope.java21
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVariable.java46
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java138
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPASTInternalScope.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPClassSpecializationScope.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalClassTypeMixinHost.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AccessContext.java34
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AutoTypeResolver.java22
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java146
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java33
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java108
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java316
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/SemanticUtil.java47
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java30
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CPPTypedefClone.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IIndexFragmentBinding.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeIndexBinding.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java18
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CCompositesFactory.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCCompositeScope.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCField.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCFunction.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCParameter.java10
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCStructure.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCVariable.java10
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassScope.java40
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java65
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecializationScope.java22
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplatePartialSpecialization.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplatePartialSpecializationSpecialization.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java35
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructor.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorInstance.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorSpecialization.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorTemplate.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorTemplateSpecialization.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumScope.java7
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFieldSpecialization.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java18
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionSpecialization.java13
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodInstance.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodSpecialization.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplate.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplateSpecialization.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceAlias.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceScope.java36
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameterSpecialization.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedefSpecialization.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUnknownClassType.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.java10
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java100
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMASTAdapter.java42
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java42
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCAnnotation.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCFunction.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java39
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCParameter.java18
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCStructure.java48
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCVariable.java10
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPAnnotation.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPBase.java9
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassScope.java22
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java23
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java27
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java64
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructor.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorInstance.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorSpecialization.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorTemplate.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorTemplateSpecialization.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPDeferredClassInstance.java6
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumeration.java23
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFieldSpecialization.java18
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunction.java17
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionInstance.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionSpecialization.java38
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java113
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodInstance.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodSpecialization.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplate.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplateSpecialization.java11
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespaceAlias.java5
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameter.java20
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameterSpecialization.java12
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassInstance.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassType.java32
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDirective.java4
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPVariable.java16
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMClassUtil.java14
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java26
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/SemanticHighlightings.java16
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/IndexLabelProvider.java26
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/MethodContext.java15
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/Visibility.java5
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/extractlocalvariable/ExtractLocalVariableRefactoring.java17
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/ASTManager.java41
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRefactoringArgument.java12
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRenameClassProcessor.java31
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRenameLocalProcessor.java16
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRenameMethodProcessor.java9
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/LinkedNamesFinder.java39
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/PDOMSearchPatternQuery.java7
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/actions/OpenDeclarationsJob.java10
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/DOMCompletionProposalComputer.java135
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/typehierarchy/THGraph.java24
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/IndexUI.java148
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/action/deprecated/C99ResolveParserAction.java31
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99CompositeTypeScope.java5
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Enumeration.java3
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Enumerator.java3
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Field.java9
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Label.java5
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Scope.java8
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Structure.java5
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Typedef.java5
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/old/org/eclipse/cdt/internal/core/dom/lrparser/c99/bindings/C99Variable.java5
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser/src/org/eclipse/cdt/core/dom/lrparser/action/BuildASTParserAction.java20
234 files changed, 2415 insertions, 3438 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java
index c8b13ca899..0dd90a2fc8 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java
@@ -23,7 +23,6 @@ import junit.framework.AssertionFailedError;
import org.eclipse.cdt.core.dom.ast.ASTSignatureUtil;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
import org.eclipse.cdt.core.dom.ast.IASTCastExpression;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
@@ -470,7 +469,7 @@ public class AST2BaseTest extends BaseTestCase {
return clazz.cast(o);
}
- protected static void assertField(IBinding binding, String fieldName, String ownerName) throws DOMException {
+ protected static void assertField(IBinding binding, String fieldName, String ownerName) {
assertInstance(binding, IField.class);
assertEquals(fieldName, binding.getName());
ICompositeType struct = ((IField) binding).getCompositeTypeOwner();
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
index 9d61487821..9b956833e2 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2CPPTests.java
@@ -3419,7 +3419,7 @@ public class AST2CPPTests extends AST2BaseTest {
IProblemBinding B = (IProblemBinding) col.getName(2).resolveBinding();
assertEquals(B.getID(), IProblemBinding.SEMANTIC_NAME_NOT_FOUND);
IProblemBinding C = (IProblemBinding) col.getName(3).resolveBinding();
- assertEquals(C.getID(), IProblemBinding.SEMANTIC_BAD_SCOPE);
+ assertEquals(C.getID(), IProblemBinding.SEMANTIC_NAME_NOT_FOUND);
}
public void testBug88459() throws Exception {
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java
index 066846e11f..d489765c86 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexCPPBindingResolutionTest.java
@@ -1637,23 +1637,19 @@ public abstract class IndexCPPBindingResolutionTest extends IndexBindingResoluti
int friends,
int constructors,
int nestedClasses) {
- try {
- assertTrue(type instanceof ICPPClassType);
- ICPPClassType classType = (ICPPClassType) type;
- assertQNEquals(qn, classType);
- assertEquals(key, classType.getKey());
- assertEquals(bases, classType.getBases().length);
- assertEquals(fields, classType.getFields().length);
- assertEquals(declaredFields, classType.getDeclaredFields().length);
- assertEquals(methods, classType.getMethods().length);
- assertEquals(declaredMethods, classType.getDeclaredMethods().length);
- assertEquals(allDeclaredMethods, classType.getAllDeclaredMethods().length);
- // assertEquals(friends, classType.getFriends().length); (PDOMNotImplementedError)
- assertEquals(constructors, classType.getConstructors().length);
- assertEquals(nestedClasses, classType.getNestedClasses().length);
- } catch (DOMException de) {
- fail(de.getMessage());
- }
+ assertTrue(type instanceof ICPPClassType);
+ ICPPClassType classType = (ICPPClassType) type;
+ assertQNEquals(qn, classType);
+ assertEquals(key, classType.getKey());
+ assertEquals(bases, classType.getBases().length);
+ assertEquals(fields, classType.getFields().length);
+ assertEquals(declaredFields, classType.getDeclaredFields().length);
+ assertEquals(methods, classType.getMethods().length);
+ assertEquals(declaredMethods, classType.getDeclaredMethods().length);
+ assertEquals(allDeclaredMethods, classType.getAllDeclaredMethods().length);
+ // assertEquals(friends, classType.getFriends().length); (PDOMNotImplementedError)
+ assertEquals(constructors, classType.getConstructors().length);
+ assertEquals(nestedClasses, classType.getNestedClasses().length);
}
public void assertEnumeration(IBinding binding, String name, String[] enumerators) throws DOMException {
diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java
index 48b1d9f502..f9c06c3f56 100644
--- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java
+++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/IndexModelUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 QNX Software Systems and others.
+ * Copyright (c) 2006, 2010 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
@@ -14,7 +14,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.browser;
-import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
@@ -49,48 +48,44 @@ public class IndexModelUtil {
* @return whether the binding is of any of the specified CElement type constants
*/
public static boolean bindingHasCElementType(IBinding binding, int[] kinds) {
- try {
- for (int kind : kinds) {
- switch(kind) {
- case ICElement.C_STRUCT:
- if (binding instanceof ICompositeType
- && ((ICompositeType)binding).getKey() == ICompositeType.k_struct)
- return true;
- break;
- case ICElement.C_UNION:
- if (binding instanceof ICompositeType
- && ((ICompositeType)binding).getKey() == ICompositeType.k_union)
- return true;
- break;
- case ICElement.C_CLASS:
- if (binding instanceof ICompositeType
- && ((ICompositeType)binding).getKey() == ICPPClassType.k_class)
- return true;
- break;
- case ICElement.C_NAMESPACE:
- if (binding instanceof ICPPNamespace || binding instanceof ICPPNamespaceAlias)
- return true;
- break;
- case ICElement.C_ENUMERATION:
- if (binding instanceof IEnumeration)
- return true;
- break;
- case ICElement.C_TYPEDEF:
- if(binding instanceof ITypedef)
- return true;
- break;
- case ICElement.C_FUNCTION:
- if(binding instanceof IFunction)
- return true;
- break;
- case ICElement.C_VARIABLE:
- if(binding instanceof IVariable)
- return true;
- break;
- }
+ for (int kind : kinds) {
+ switch(kind) {
+ case ICElement.C_STRUCT:
+ if (binding instanceof ICompositeType
+ && ((ICompositeType)binding).getKey() == ICompositeType.k_struct)
+ return true;
+ break;
+ case ICElement.C_UNION:
+ if (binding instanceof ICompositeType
+ && ((ICompositeType)binding).getKey() == ICompositeType.k_union)
+ return true;
+ break;
+ case ICElement.C_CLASS:
+ if (binding instanceof ICompositeType
+ && ((ICompositeType)binding).getKey() == ICPPClassType.k_class)
+ return true;
+ break;
+ case ICElement.C_NAMESPACE:
+ if (binding instanceof ICPPNamespace || binding instanceof ICPPNamespaceAlias)
+ return true;
+ break;
+ case ICElement.C_ENUMERATION:
+ if (binding instanceof IEnumeration)
+ return true;
+ break;
+ case ICElement.C_TYPEDEF:
+ if(binding instanceof ITypedef)
+ return true;
+ break;
+ case ICElement.C_FUNCTION:
+ if(binding instanceof IFunction)
+ return true;
+ break;
+ case ICElement.C_VARIABLE:
+ if(binding instanceof IVariable)
+ return true;
+ break;
}
- } catch(DOMException de) {
- CCorePlugin.log(de);
}
return false;
}
@@ -105,20 +100,16 @@ public class IndexModelUtil {
if (binding instanceof ICompositeType) {
ICompositeType classType = (ICompositeType) binding;
- try {
- switch(classType.getKey()) {
- case ICPPClassType.k_class:
- elementType = ICElement.C_CLASS;
- break;
- case ICompositeType.k_struct:
- elementType = ICElement.C_STRUCT;
- break;
- case ICompositeType.k_union:
- elementType = ICElement.C_UNION;
- break;
- }
- } catch(DOMException de) {
- CCorePlugin.log(de);
+ switch(classType.getKey()) {
+ case ICPPClassType.k_class:
+ elementType = ICElement.C_CLASS;
+ break;
+ case ICompositeType.k_struct:
+ elementType = ICElement.C_STRUCT;
+ break;
+ case ICompositeType.k_union:
+ elementType = ICElement.C_UNION;
+ break;
}
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CElementBaseLabels.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CElementBaseLabels.java
index 4466e47fe4..b1b2a7fb4e 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CElementBaseLabels.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CElementBaseLabels.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corp. - Rational Software - initial implementation
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
* Markus Schorn (Wind River Systems)
* Gerhard Schaber (Wind River Systems)
*******************************************************************************/
@@ -37,7 +37,6 @@ import org.eclipse.core.runtime.Path;
/**
* Creates labels for ICElement objects.
- * @author aniefer
*/
public class CElementBaseLabels {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java
index 9db060c08e..8702443d89 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2010 Wind River Systems, Inc. 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
@@ -281,17 +281,13 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
protected ASTAccessVisibility getVisibility(IBinding binding) {
if (binding instanceof ICPPMember) {
ICPPMember member= (ICPPMember) binding;
- try {
- switch (member.getVisibility()) {
- case ICPPMember.v_private:
- return ASTAccessVisibility.PRIVATE;
- case ICPPMember.v_protected:
- return ASTAccessVisibility.PROTECTED;
- case ICPPMember.v_public:
- return ASTAccessVisibility.PUBLIC;
- }
- } catch (DOMException e) {
- CCorePlugin.log(e);
+ switch (member.getVisibility()) {
+ case ICPPMember.v_private:
+ return ASTAccessVisibility.PRIVATE;
+ case ICPPMember.v_protected:
+ return ASTAccessVisibility.PROTECTED;
+ case ICPPMember.v_public:
+ return ASTAccessVisibility.PUBLIC;
}
}
return ASTAccessVisibility.PUBLIC;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FieldHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FieldHandle.java
index 2f86510847..7eba605156 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FieldHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FieldHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2010 Wind River Systems, Inc. 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,11 +8,8 @@
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
-
package org.eclipse.cdt.internal.core.model.ext;
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
@@ -26,12 +23,7 @@ public class FieldHandle extends CElementHandle implements org.eclipse.cdt.core.
public FieldHandle(ICElement parent, IField field) {
super(parent, ICElement.C_FIELD, field.getName());
fVisibility= getVisibility(field);
- try {
- fIsStatic= field.isStatic();
- } catch (DOMException e) {
- CCorePlugin.log(e);
- fIsStatic= false;
- }
+ fIsStatic= field.isStatic();
}
public ASTAccessVisibility getVisibility() throws CModelException {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionDeclarationHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionDeclarationHandle.java
index 16716a39e6..d809f02c52 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionDeclarationHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionDeclarationHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2010 Wind River Systems, Inc. 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
@@ -9,10 +9,8 @@
* Markus Schorn - initial API and implementation
* Anton Leherbauer (Wind River Systems)
*******************************************************************************/
-
package org.eclipse.cdt.internal.core.model.ext;
-import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IFunction;
import org.eclipse.cdt.core.model.CModelException;
@@ -32,12 +30,7 @@ public class FunctionDeclarationHandle extends CElementHandle implements org.ecl
protected FunctionDeclarationHandle(ICElement parent, int type, IFunction func) throws DOMException {
super(parent, type, func.getName());
fParameterTypes= extractParameterTypes(func);
- try {
- fIsStatic= func.isStatic();
- } catch (DOMException e) {
- CCorePlugin.log(e);
- fIsStatic= false;
- }
+ fIsStatic= func.isStatic();
}
@Override
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java
index ba21b2ab99..aade00913d 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2010 Wind River Systems, Inc. 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,10 +8,8 @@
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
-
package org.eclipse.cdt.internal.core.model.ext;
-import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
@@ -37,14 +35,10 @@ public class MethodDeclarationHandle extends CElementHandle implements IMethodDe
super(parent, type, method.getName());
fParameterTypes= extractParameterTypes(method);
fVisibility= getVisibility(method);
- try {
- fIsStatic= method.isStatic();
- fIsConstructor= method instanceof ICPPConstructor;
- if (!fIsConstructor)
- fIsDestructor= method.isDestructor();
- } catch (DOMException e) {
- CCorePlugin.log(e);
- }
+ fIsStatic= method.isStatic();
+ fIsConstructor= method instanceof ICPPConstructor;
+ if (!fIsConstructor)
+ fIsDestructor= method.isDestructor();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/VariableHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/VariableHandle.java
index 99c35275d7..e243ad600d 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/VariableHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/VariableHandle.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2010 Wind River Systems, Inc. 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,11 +8,8 @@
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
-
package org.eclipse.cdt.internal.core.model.ext;
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IVariable;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
@@ -22,12 +19,7 @@ public class VariableHandle extends CElementHandle implements org.eclipse.cdt.co
public VariableHandle(ICElement parent, IVariable var) {
super(parent, ICElement.C_VARIABLE, var.getName());
- try {
- fIsStatic= var.isStatic();
- } catch (DOMException e) {
- CCorePlugin.log(e);
- fIsStatic= false;
- }
+ fIsStatic= var.isStatic();
}
public boolean isStatic() throws CModelException {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
index 4ae35d28f5..7418594489 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeUtil.java
@@ -346,12 +346,8 @@ public class ASTTypeUtil {
} else if (type instanceof ICompositeType) {
// 101114 fix, do not display class, and for consistency don't display struct/union as well
if (type instanceof ICPPClassType) {
- try {
- String qn = CPPVisitor.renderQualifiedName(getQualifiedNameForAnonymous((ICPPClassType) type, normalize));
- result.append(qn);
- } catch (DOMException e) {
- result.append(getNameForAnonymous((ICompositeType) type));
- }
+ String qn = CPPVisitor.renderQualifiedName(getQualifiedNameForAnonymous((ICPPClassType) type, normalize));
+ result.append(qn);
} else {
result.append(getNameForAnonymous((ICompositeType) type));
}
@@ -695,7 +691,7 @@ public class ASTTypeUtil {
}
}
- private static String[] getQualifiedNameForAnonymous(ICPPBinding binding, boolean normalize) throws DOMException {
+ private static String[] getQualifiedNameForAnonymous(ICPPBinding binding, boolean normalize) {
LinkedList<String> result= new LinkedList<String>();
result.addFirst(getNameForAnonymous(binding));
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBinding.java
index 90eb768351..5bca19d555 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IBinding.java
@@ -65,7 +65,7 @@ public interface IBinding extends IAdaptable {
* <br> <code>null</code>: for types, functions, variables, namespaces and using declarations;
* @since 5.1
*/
- public IBinding getOwner() throws DOMException;
+ public IBinding getOwner();
/**
* Returns the parent scope for this binding. A binding may have declarations in multiple scopes,
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ICompositeType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ICompositeType.java
index 25f55d297f..e076c4ebca 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ICompositeType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ICompositeType.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM - Initial API and implementation
+ * IBM - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast;
@@ -24,7 +24,7 @@ public interface ICompositeType extends IBinding, IType {
/**
* what kind of composite type is this?
*/
- public int getKey() throws DOMException;
+ public int getKey();
/**
* Returns whether the type is anonymous or not. A type for which objects or
@@ -36,14 +36,14 @@ public interface ICompositeType extends IBinding, IType {
* </pre>
* @since 5.1
*/
- boolean isAnonymous() throws DOMException;
+ boolean isAnonymous();
/**
* Returns the fields for this type.
*
* @return List of IField
*/
- public IField[] getFields() throws DOMException;
+ public IField[] getFields();
/**
* returns the field that matches name,
@@ -51,11 +51,10 @@ public interface ICompositeType extends IBinding, IType {
*
* @param name
*/
- public IField findField( String name ) throws DOMException;
+ public IField findField(String name);
/**
* get the IScope object that is associated with this composite type
- * @throws DOMException
*/
- public IScope getCompositeScope() throws DOMException;
+ public IScope getCompositeScope();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IField.java
index 072c5bfc80..38e269ebeb 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IField.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IField.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -21,9 +21,7 @@ public interface IField extends IVariable {
/**
* Returns the composite type that owns the field.
- * @throws DOMException
* @since 4.0
*/
- ICompositeType getCompositeTypeOwner() throws DOMException;
-
+ ICompositeType getCompositeTypeOwner();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunction.java
index 93b1c3fb72..70ba80bbc1 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IFunction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -44,22 +44,19 @@ public interface IFunction extends IBinding {
/**
* Returns {@code true} if the function has the static storage-class specifier
* similarly for extern, auto, register.
- * @throws DOMException if this is a problem binding.
*/
- public boolean isStatic() throws DOMException;
- public boolean isExtern() throws DOMException;
- public boolean isAuto() throws DOMException;
- public boolean isRegister() throws DOMException;
+ public boolean isStatic();
+ public boolean isExtern();
+ public boolean isAuto();
+ public boolean isRegister();
/**
* Returns {@code true} if the function is inline.
- * @throws DOMException if this is a problem binding.
*/
- public boolean isInline() throws DOMException;
+ public boolean isInline();
/**
* Returns {@code true} if this function takes variable arguments.
- * @throws DOMException if this is a problem binding.
*/
- public boolean takesVarArgs() throws DOMException;
+ public boolean takesVarArgs();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ILabel.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ILabel.java
index 4454ba3298..5ac671ed9a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ILabel.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ILabel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -23,6 +23,6 @@ public interface ILabel extends IBinding {
* Returns the label statement for this label.
*
*/
- public IASTLabelStatement getLabelStatement() throws DOMException;
+ public IASTLabelStatement getLabelStatement();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java
index 8cc4dfaf2c..7ec52b91ef 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -33,9 +33,8 @@ public interface IScope {
/**
* Get the IName for this scope, may be null
* @return The name of this scope.
- * @throws DOMException
*/
- public IName getScopeName() throws DOMException;
+ public IName getScopeName();
/**
* The method returns the first enclosing non-template scope, or <code>null</code> if this
@@ -55,7 +54,7 @@ public interface IScope {
* @param name
* @return An array of bindings.
*/
- public IBinding[] find(String name) throws DOMException;
+ public IBinding[] find(String name);
/**
* Get the binding in this scope that the given name would resolve to. Could
@@ -68,9 +67,8 @@ public interface IScope {
* whether or not to resolve the matching binding if it has not
* been so already.
* @return : the binding in this scope that matches the name, or null
- * @throws DOMException
*/
- public IBinding getBinding(IASTName name, boolean resolve) throws DOMException;
+ public IBinding getBinding(IASTName name, boolean resolve);
/**
* Get the binding in this scope that the given name would resolve to. Could
@@ -85,9 +83,8 @@ public interface IScope {
* been so already.
* @param acceptLocalBindings a set of files for which to accept local bindings.
* @return : the binding in this scope that matches the name, or null
- * @throws DOMException
*/
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings) throws DOMException;
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings);
/**
* Get the bindings in this scope that the given name or prefix could resolve to. Could
@@ -101,9 +98,8 @@ public interface IScope {
* been so already.
* @param prefixLookup whether the lookup is for a full name or a prefix
* @return : the bindings in this scope that match the name or prefix, or null
- * @throws DOMException
*/
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup) throws DOMException;
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup);
/**
* Get the bindings in this scope that the given name or prefix could resolve to. Could
@@ -118,8 +114,7 @@ public interface IScope {
* @param prefixLookup whether the lookup is for a full name or a prefix
* @param acceptLocalBindings a set of files for which to accept local bindings.
* @return : the bindings in this scope that match the name or prefix, or null
- * @throws DOMException
*/
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet acceptLocalBindings) throws DOMException;
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet acceptLocalBindings);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IVariable.java
index a1c64cbf4b..28c553b171 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IVariable.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -34,20 +34,20 @@ public interface IVariable extends IBinding {
/**
* Returns whether this variable is declared static.
*/
- public boolean isStatic() throws DOMException;
+ public boolean isStatic();
/**
* Returns whether this variable is declared extern.
*/
- public boolean isExtern() throws DOMException;
+ public boolean isExtern();
/**
* Returns whether this variable is an automatic variable.
*/
- public boolean isAuto() throws DOMException;
+ public boolean isAuto();
/**
* Returns whether this variable is declared register.
*/
- public boolean isRegister() throws DOMException;
+ public boolean isRegister();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICCompositeTypeScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICCompositeTypeScope.java
index 19b12e8fac..d6fdf32d95 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICCompositeTypeScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICCompositeTypeScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.c;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.ICompositeType;
@@ -23,11 +22,8 @@ public interface ICCompositeTypeScope extends ICScope {
/**
* get the binding for the member that has been previous added to this scope
* and that matches the given name.
- *
- * @param name
- * @throws DOMException
*/
- public IBinding getBinding(char[] name) throws DOMException;
+ public IBinding getBinding(char[] name);
/**
* Get the type this scope is associated with
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPBase.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPBase.java
index 81de4e16bc..b00f57b3b4 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPBase.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPBase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.core.dom.ast.cpp;
import org.eclipse.cdt.core.dom.IName;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
@@ -33,7 +32,7 @@ public interface ICPPBase extends Cloneable {
* The base class. Generally a ICPPClassType, but may be a ICPPTemplateParameter.
* In the case of typedefs, the target type will be returned instead of the typedef itself.
*/
- public IBinding getBaseClass() throws DOMException;
+ public IBinding getBaseClass();
/**
* Returns the name that specifies the base class.
@@ -45,13 +44,13 @@ public interface ICPPBase extends Cloneable {
* The visibility qualifier applied to the base class.
*
*/
- public int getVisibility() throws DOMException;
+ public int getVisibility();
/**
* Whether this is a virtual base class.
*/
- public boolean isVirtual() throws DOMException;
+ public boolean isVirtual();
/**
* @since 5.1
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassScope.java
index 153dffdd71..6938527c52 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
/**
* Interface for class scopes.
@@ -39,5 +38,5 @@ public interface ICPPClassScope extends ICPPScope {
* Returns the array of constructors, including implicit ones.
* @since 5.1
*/
- public ICPPConstructor[] getConstructors() throws DOMException;
+ public ICPPConstructor[] getConstructors();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassTemplatePartialSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassTemplatePartialSpecialization.java
index e157c32305..c6de47a82f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassTemplatePartialSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassTemplatePartialSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -31,7 +31,7 @@ public interface ICPPClassTemplatePartialSpecialization extends ICPPClassTemplat
/**
* get the ICPPTemplateDefinition which this is a specialization of
*/
- public ICPPClassTemplate getPrimaryClassTemplate() throws DOMException;
+ public ICPPClassTemplate getPrimaryClassTemplate();
/**
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java
index 3d61ba60f0..de6b52dc37 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IField;
@@ -31,13 +30,13 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
*
* @return List of ICPPBase
*/
- public ICPPBase[] getBases() throws DOMException;
+ public ICPPBase[] getBases();
/**
* Get fields is restated here just to point out that this method returns a
* list of ICPPField objects representing all fields, declared or inherited.
*/
- public IField[] getFields() throws DOMException;
+ public IField[] getFields();
/**
* findField is restated here to point out that this method looks through
@@ -47,7 +46,7 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
*
* @param name
*/
- public IField findField(String name) throws DOMException;
+ public IField findField(String name);
/**
* Returns a list of ICPPField objects representing fields declared in this
@@ -55,7 +54,7 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
*
* @return List of ICPPField
*/
- public ICPPField[] getDeclaredFields() throws DOMException;
+ public ICPPField[] getDeclaredFields();
/**
* Returns a list of ICPPMethod objects representing all methods defined for
@@ -64,7 +63,7 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
*
* @return List of ICPPMethod
*/
- public ICPPMethod[] getMethods() throws DOMException;
+ public ICPPMethod[] getMethods();
/**
* Returns a list of ICPPMethod objects representing all method explicitly
@@ -73,7 +72,7 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
*
* @return List of ICPPMethod
*/
- public ICPPMethod[] getAllDeclaredMethods() throws DOMException;
+ public ICPPMethod[] getAllDeclaredMethods();
/**
* Returns a list of ICPPMethod objects representing all methods explicitly
@@ -82,7 +81,7 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
*
* @return List of ICPPMethod
*/
- public ICPPMethod[] getDeclaredMethods() throws DOMException;
+ public ICPPMethod[] getDeclaredMethods();
/**
* Returns an array of ICPPConstructor objects representing the constructors
@@ -90,19 +89,16 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding {
* constructors.
*
*/
- public ICPPConstructor[] getConstructors() throws DOMException;
+ public ICPPConstructor[] getConstructors();
/**
* return an array of bindings for those classes/functions declared as
* friends of this class.
- *
- * @throws DOMException
*/
- public IBinding[] getFriends() throws DOMException;
+ public IBinding[] getFriends();
/**
* return an array of nested classes/structures
- * @throws DOMException
*/
- public ICPPClassType[] getNestedClasses() throws DOMException;
+ public ICPPClassType[] getNestedClasses();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPConstructor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPConstructor.java
index 8972486544..cd3db295af 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPConstructor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPConstructor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
/**
* @noextend This interface is not intended to be extended by clients.
@@ -20,9 +19,7 @@ public interface ICPPConstructor extends ICPPMethod {
public static final ICPPConstructor [] EMPTY_CONSTRUCTOR_ARRAY = new ICPPConstructor[0];
/**
* Whether or not this constructor was declared as explicit
- *
- * @throws DOMException
*/
- boolean isExplicit() throws DOMException;
+ boolean isExplicit();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPFunction.java
index 1961577941..fe621907a1 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPFunction.java
@@ -25,27 +25,26 @@ public interface ICPPFunction extends IFunction, ICPPBinding {
/**
* does this function have the mutable storage class specifier
- * @throws DOMException
*/
- public boolean isMutable() throws DOMException;
+ public boolean isMutable();
/**
* is this an inline function
*/
- public boolean isInline() throws DOMException;
+ public boolean isInline();
/**
* Returns whether this function is declared as extern "C".
* @since 5.0
*/
- public boolean isExternC() throws DOMException;
+ public boolean isExternC();
/**
* Returns the exception specification for this function or <code>null</code> if there
* is no exception specification.
* @since 5.1
*/
- public IType[] getExceptionSpecification() throws DOMException;
+ public IType[] getExceptionSpecification();
/**
* {@inheritDoc}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMember.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMember.java
index 903de6237f..f61deba799 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMember.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMember.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -29,19 +29,19 @@ public interface ICPPMember extends ICPPBinding {
/**
* Returns the accessibility of the member.
*/
- public int getVisibility() throws DOMException;
+ public int getVisibility();
/**
* Same as {@link #getOwner()}.
*/
- public ICPPClassType getClassOwner() throws DOMException;
+ public ICPPClassType getClassOwner();
/**
* Returns whether this is a static member or not.
* @since 5.1
*/
- public boolean isStatic() throws DOMException;
+ public boolean isStatic();
/**
* Returns the type of the member (function type or type of field)
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMethod.java
index e2349af053..ca29b804f2 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMethod.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPMethod.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
/**
* Base interface for methods, also used for constructors.
@@ -25,7 +24,7 @@ public interface ICPPMethod extends ICPPFunction, ICPPMember {
* Returns whether this method is declared to be virtual. Does not detect whether
* the method is virtual because of overriding a virtual method from a base class.
*/
- public boolean isVirtual() throws DOMException;
+ public boolean isVirtual();
/**
* is this a destructor
@@ -44,5 +43,5 @@ public interface ICPPMethod extends ICPPFunction, ICPPMember {
* Returns whether this is a pure abstract method
* @since 5.1
*/
- public boolean isPureVirtual() throws DOMException;
+ public boolean isPureVirtual();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPNamespace.java
index b55f11eedd..275bddc450 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPNamespace.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPNamespace.java
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
/**
@@ -23,16 +22,13 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
public interface ICPPNamespace extends ICPPBinding {
/**
* get the scope object associated with this namespace
- *
- * @throws DOMException
*/
- public ICPPNamespaceScope getNamespaceScope() throws DOMException;
+ public ICPPNamespaceScope getNamespaceScope();
/**
* get an array of the all the bindings declared in this namespace.
- * @throws DOMException
*/
- public IBinding[] getMemberBindings() throws DOMException;
+ public IBinding[] getMemberBindings();
/**
* Returns whether this is an inline namespace.
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPVariable.java
index 80e30482df..c9144497a3 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPVariable.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IVariable;
/**
@@ -22,12 +21,11 @@ public interface ICPPVariable extends IVariable, ICPPBinding {
/**
* does this variable have the mutable storage class specifier
- * @throws DOMException
*/
- public boolean isMutable() throws DOMException;
+ public boolean isMutable();
/**
* Returns whether this variable is declared as extern "C".
*/
- public boolean isExternC() throws DOMException;
+ public boolean isExternC();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexBinding.java
index 9d21afdfe6..e981b2789f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2010 Wind River Systems, Inc. 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.core.index;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.core.runtime.CoreException;
@@ -48,5 +47,5 @@ public interface IIndexBinding extends IBinding {
* {@inheritDoc}
* @since 5.1
*/
- IIndexBinding getOwner() throws DOMException;
+ IIndexBinding getOwner();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArraySet.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArraySet.java
index 320c21f3da..723c5c4b11 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArraySet.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArraySet.java
@@ -1,25 +1,18 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
*******************************************************************************/
-
-/*
- * Created on Jul 21, 2004
- */
package org.eclipse.cdt.core.parser.util;
import java.util.Collections;
import java.util.List;
-/**
- * @author aniefer
- */
public class CharArraySet extends CharTable {
public static final CharArraySet EMPTY_SET = new CharArraySet( 0 ){
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectMap.java
index 36c030e36d..bb456bed4a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectMap.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectMap.java
@@ -1,27 +1,19 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
*******************************************************************************/
-
-/*
- * cloned from CharArrayMap & CharArrayObjectMap
- * Created on Jul 14, 2004
- */
package org.eclipse.cdt.core.parser.util;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
-/**
- * @author aniefer
- */
public class ObjectMap extends ObjectTable<Object> {
public static final ObjectMap EMPTY_MAP = new ObjectMap(0) {
@Override
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectSet.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectSet.java
index b25c7106bc..9fb851c199 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectSet.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectSet.java
@@ -1,21 +1,18 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.core.parser.util;
import java.util.Collections;
import java.util.List;
-/**
- * @author aniefer
- */
public class ObjectSet<T> extends ObjectTable<T> {
/**
* Represents the empty ObjectSet
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java
index 86d889b615..fcd6e2e04d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java
@@ -1,18 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
*******************************************************************************/
-
-/*
- * For use by the Parser Symbol Table
- * Created on Jul 15, 2004
- */
package org.eclipse.cdt.core.parser.util;
import java.lang.reflect.Array;
@@ -20,9 +15,6 @@ import java.util.ArrayList;
import java.util.List;
-/**
- * @author aniefer
- */
public abstract class ObjectTable<T> extends HashTable {
protected T[] keyTable;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTInternal.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTInternal.java
index 508c780774..359aca1e23 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTInternal.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ASTInternal.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2010 Wind River Systems, Inc. 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -35,14 +34,14 @@ public class ASTInternal {
return IASTNode.EMPTY_NODE_ARRAY;
}
- public static IASTNode getPhysicalNodeOfScope(IScope scope) throws DOMException {
+ public static IASTNode getPhysicalNodeOfScope(IScope scope) {
if (scope instanceof IASTInternalScope) {
return ((IASTInternalScope) scope).getPhysicalNode();
}
return null;
}
- public static void addBinding(IScope scope, IBinding binding) throws DOMException {
+ public static void addBinding(IScope scope, IBinding binding) {
if (scope instanceof IASTInternalScope) {
((IASTInternalScope) scope).addBinding(binding);
}
@@ -50,15 +49,11 @@ public class ASTInternal {
public static void addName(IScope scope, IASTName name) {
if (scope instanceof IASTInternalScope) {
- try {
- ((IASTInternalScope) scope).addName(name);
- } catch (DOMException e) {
- // name is not cached in scope
- }
+ ((IASTInternalScope) scope).addName(name);
}
}
- public static boolean isStatic(IFunction func, boolean resolveAll) throws DOMException {
+ public static boolean isStatic(IFunction func, boolean resolveAll) {
if (func instanceof ICPPInternalFunction) {
return ((ICPPInternalFunction)func).isStatic(resolveAll);
}
@@ -100,8 +95,7 @@ public class ASTInternal {
}
}
if (decls != null) {
- for (int i = 0; i < decls.length; i++) {
- final IASTNode node= decls[i];
+ for (final IASTNode node : decls) {
if (node != null) {
if ( (filePath= isPartOfSource(filePath, node)) == null) {
return null;
@@ -153,8 +147,7 @@ public class ASTInternal {
filePath= def.getContainingFilename();
}
if (decls != null) {
- for (int i = 0; i < decls.length; i++) {
- final IASTNode node= decls[i];
+ for (final IASTNode node : decls) {
if (node != null) {
final String fn = node.getContainingFilename();
if (filePath == null) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/IASTInternalScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/IASTInternalScope.java
index aab740d46a..1cb20611cc 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/IASTInternalScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/IASTInternalScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2010 Wind River Systems, Inc. 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -28,19 +27,13 @@ public interface IASTInternalScope extends IScope {
/**
* This adds an IBinding to the scope. It is primarily used by the parser to add
* implicit IBindings to the scope (such as GCC built-in functions).
- *
- * @param binding
- * @throws DOMException
*/
- public void addBinding(IBinding binding) throws DOMException;
+ public void addBinding(IBinding binding);
/**
* Add an IASTName to be cached in this scope
- *
- * @param name
- * @throws DOMException
*/
- public void addName(IASTName name) throws DOMException;
+ public void addName(IASTName name);
/**
* Can be called during ambiguity resolution to populate a scope without considering
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java
index b22d16fffe..4ee15d3bea 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/ProblemBinding.java
@@ -13,8 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser;
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.IName;
import org.eclipse.cdt.core.dom.ast.DOMException;
@@ -26,6 +24,7 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType;
+import org.eclipse.cdt.core.dom.ast.IValue;
import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.internal.core.dom.Linkage;
@@ -34,6 +33,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.cdt.internal.core.parser.ParserMessages;
import org.eclipse.core.runtime.PlatformObject;
+import com.ibm.icu.text.MessageFormat;
+
/**
* Implementation of problem bindings
*/
@@ -172,8 +173,8 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#find(java.lang.String)
*/
- public IBinding[] find(String name) throws DOMException {
- throw new DOMException(this);
+ public IBinding[] find(String name) {
+ return IBinding.EMPTY_BINDING_ARRAY;
}
/* (non-Javadoc)
@@ -186,34 +187,32 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#addName(org.eclipse.cdt.core.dom.ast.IASTName)
*/
- public void addName(IASTName name) throws DOMException {
- throw new DOMException(this);
+ public void addName(IASTName name) {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#getBinding(org.eclipse.cdt.core.dom.ast.IASTName, boolean)
*/
- public IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
- throw new DOMException(this);
+ public IBinding getBinding(IASTName name, boolean resolve) {
+ return null;
}
- public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix)
- throws DOMException {
- throw new DOMException(this);
+ public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) {
+ return IBinding.EMPTY_BINDING_ARRAY;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#getBinding(org.eclipse.cdt.core.dom.ast.IASTName, boolean)
*/
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
- throw new DOMException(this);
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
+ return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#getBinding(org.eclipse.cdt.core.dom.ast.IASTName, boolean)
*/
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
- throw new DOMException(this);
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
+ return IBinding.EMPTY_BINDING_ARRAY;
}
/* (non-Javadoc)
@@ -239,8 +238,7 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I
return -1;
}
- public void addBinding(IBinding binding) throws DOMException {
- throw new DOMException(this);
+ public void addBinding(IBinding binding) {
}
public ILinkage getLinkage() {
@@ -252,7 +250,7 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I
return getMessage();
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return node instanceof IASTName ? CPPVisitor.findNameOwner((IASTName) node, true) : null;
}
@@ -265,4 +263,73 @@ public class ProblemBinding extends PlatformObject implements IProblemBinding, I
public void populateCache() {
}
+
+
+ // Dummy methods for derived classes
+ public IType getType() throws DOMException {
+ throw new DOMException(this);
+ }
+ public boolean isStatic() {
+ return false;
+ }
+ 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 isMutable() {
+ return false;
+ }
+ public boolean isExtern() {
+ return false;
+ }
+ public boolean isExternC() {
+ return false;
+ }
+ public boolean isAuto() {
+ return false;
+ }
+ public boolean isRegister() {
+ return false;
+ }
+ public IValue getInitialValue() {
+ return null;
+ }
+ public boolean isAnonymous() {
+ return false;
+ }
+ public boolean isDeleted() {
+ return false;
+ }
+ public boolean isInline() {
+ return false;
+ }
+ public boolean takesVarArgs() {
+ return false;
+ }
+ public IType[] getExceptionSpecification() {
+ return null;
+ }
+ public boolean hasParameterPack() {
+ return false;
+ }
+ public boolean isVirtual() {
+ return false;
+ }
+ public boolean isPureVirtual() {
+ return false;
+ }
+ public boolean isImplicit() {
+ return false;
+ }
+ public boolean hasDefaultValue() {
+ return false;
+ }
+ public boolean isParameterPack() {
+ return false;
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java
index b1ec1a7c99..298af6d169 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/Value.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2008, 2010 Wind River Systems, Inc. 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
@@ -16,7 +16,6 @@ import java.util.List;
import java.util.Map;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTArraySubscriptExpression;
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
import org.eclipse.cdt.core.dom.ast.IASTCastExpression;
@@ -862,13 +861,9 @@ public class Value implements IValue {
* Computes a signature for an unknown binding.
*/
private static String getSignatureForUnknown(ICPPUnknownBinding binding) {
- try {
- IBinding owner= binding.getOwner();
- if (owner instanceof IType) {
- return ASTTypeUtil.getType((IType) owner, true) + SCOPE_OP + binding.getName();
- }
- } catch (DOMException e) {
- // ignore qualification
+ IBinding owner= binding.getOwner();
+ if (owner instanceof IType) {
+ return ASTTypeUtil.getType((IType) owner, true) + SCOPE_OP + binding.getName();
}
return binding.getName();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTElaboratedTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTElaboratedTypeSpecifier.java
index 8ce360f7de..85735f522c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTElaboratedTypeSpecifier.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTElaboratedTypeSpecifier.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -13,7 +13,6 @@
package org.eclipse.cdt.internal.core.dom.parser.c;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTCompletionContext;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@@ -122,19 +121,15 @@ public class CASTElaboratedTypeSpecifier extends CASTBaseDeclSpecifier implement
IBinding b= result[i];
if (b instanceof ICompositeType) {
ICompositeType ct= (ICompositeType) b;
- try {
- switch (ct.getKey()) {
- case ICompositeType.k_struct:
- if (getKind() != k_struct)
- b= null;
- break;
- case ICompositeType.k_union:
- if (getKind() != k_union)
- b= null;
- break;
- }
- } catch (DOMException e) {
- // ignore and propose binding
+ switch (ct.getKey()) {
+ case ICompositeType.k_struct:
+ if (getKind() != k_struct)
+ b= null;
+ break;
+ case ICompositeType.k_union:
+ if (getKind() != k_union)
+ b= null;
+ break;
}
} else if (b instanceof IEnumeration) {
if (getKind() != k_enum)
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTName.java
index 59f87c8468..ea060c3693 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTName.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTName.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -13,10 +13,8 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.c;
-import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTCompletionContext;
import org.eclipse.cdt.core.dom.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTName;
@@ -223,22 +221,17 @@ public class CASTName extends ASTNode implements IASTName, IASTCompletionContext
if (bindings[i] instanceof ICompositeType) {
ICompositeType type = (ICompositeType) bindings[i];
- try {
- switch (type.getKey()) {
- case ICompositeType.k_struct:
- if (kind != IASTElaboratedTypeSpecifier.k_struct) {
- bindings[i] = null;
- }
- break;
- case ICompositeType.k_union:
- if (kind != IASTElaboratedTypeSpecifier.k_union) {
- bindings[i] = null;
- }
- break;
+ switch (type.getKey()) {
+ case ICompositeType.k_struct:
+ if (kind != IASTElaboratedTypeSpecifier.k_struct) {
+ bindings[i] = null;
}
- } catch (DOMException e) {
- bindings[i] = null;
- CCorePlugin.log(e);
+ break;
+ case ICompositeType.k_union:
+ if (kind != IASTElaboratedTypeSpecifier.k_union) {
+ bindings[i] = null;
+ }
+ break;
}
} else {
bindings[i]= null;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CBuiltinVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CBuiltinVariable.java
index ba0a01f0d5..e7eebbfed0 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CBuiltinVariable.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CBuiltinVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Wind River Systems Inc. and others.
+ * Copyright (c) 2008, 2010 Wind River Systems Inc. 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.c;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
@@ -72,7 +71,7 @@ public class CBuiltinVariable extends CVariable {
@Override
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return null;
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CEnumeration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CEnumeration.java
index c37dc247e3..3bf43a3203 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CEnumeration.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CEnumeration.java
@@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.core.dom.parser.c;
import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier;
@@ -176,7 +175,7 @@ public class CEnumeration extends PlatformObject implements IEnumeration, ICInte
return definition;
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
IASTNode node= definition;
if (node == null && declarations != null && declarations.length > 0) {
node= declarations[0];
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CEnumerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CEnumerator.java
index adcf650935..dd1a7c1c05 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CEnumerator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CEnumerator.java
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.dom.parser.c;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
import org.eclipse.cdt.core.dom.ast.IASTName;
@@ -36,9 +35,6 @@ public class CEnumerator extends PlatformObject implements IEnumerator {
public CEnumeratorProblem(IASTNode node, int id, char[] arg) {
super(node, id, arg);
}
- public IType getType() throws DOMException {
- throw new DOMException(this);
- }
public IValue getValue() {
return Value.UNKNOWN;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CField.java
index 0343100804..c88486330e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CField.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CField.java
@@ -1,47 +1,42 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Rational Software - Initial API and implementation
+ * Andrew Niefer (IBM Rational Software) - Initial API and implementation
*******************************************************************************/
-
package org.eclipse.cdt.internal.core.dom.parser.c;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.c.ICCompositeTypeScope;
-/**
- * Created on Nov 8, 2004
- * @author aniefer
- */
public class CField extends CVariable implements IField {
- public static class CFieldProblem extends CVariable.CVariableProblem implements IField {
- public CFieldProblem(IASTNode node, int id, char[] arg) {
- super(node, id, arg);
- }
+ public static class CFieldProblem extends CVariable.CVariableProblem implements IField {
+ private ICompositeType fOwner;
+
+ public CFieldProblem(ICompositeType owner, IASTNode node, int id, char[] arg) {
+ super(node, id, arg);
+ fOwner = owner;
+ }
- public ICompositeType getCompositeTypeOwner() throws DOMException {
- throw new DOMException(this);
+ public ICompositeType getCompositeTypeOwner() {
+ return fOwner;
}
- }
+ }
- /**
- * @param name
- */
public CField(IASTName name) {
super(name);
}
-
- public ICompositeType getCompositeTypeOwner() throws DOMException {
+
+ public ICompositeType getCompositeTypeOwner() {
ICCompositeTypeScope scope = (ICCompositeTypeScope) getScope();
return scope.getCompositeType();
}
+
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunction.java
index 1c1a1ba89e..0624d1fac9 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.dom.parser.c;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@@ -472,7 +471,7 @@ public class CFunction extends PlatformObject implements IFunction, ICInternalFu
return definition;
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return null;
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunctionScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunctionScope.java
index 9382bdf2f3..61ed52b7dd 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunctionScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CFunctionScope.java
@@ -1,16 +1,16 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Rational Software - Initial API and implementation
+ * Andrew Niefer (IBM Rational Software) - Initial API and implementation
*******************************************************************************/
-
package org.eclipse.cdt.internal.core.dom.parser.c;
+import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
@@ -20,14 +20,9 @@ import org.eclipse.cdt.core.dom.ast.IASTStatement;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.ILabel;
import org.eclipse.cdt.core.dom.ast.IScope;
-import org.eclipse.cdt.core.dom.ast.c.CASTVisitor;
import org.eclipse.cdt.core.dom.ast.c.ICFunctionScope;
import org.eclipse.cdt.core.parser.util.ArrayUtil;
-/**
- * Created on Nov 8, 2004
- * @author aniefer
- */
public class CFunctionScope extends CScope implements ICFunctionScope {
public CFunctionScope( IASTFunctionDefinition function ){
super( function, EScopeKind.eLocal);
@@ -67,7 +62,7 @@ public class CFunctionScope extends CScope implements ICFunctionScope {
return (ILabel[]) ArrayUtil.trim( ILabel.class, result );
}
- static private class FindLabelsAction extends CASTVisitor {
+ static private class FindLabelsAction extends ASTVisitor {
public IASTLabelStatement [] labels = null;
public FindLabelsAction(){
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CKnRParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CKnRParameter.java
index 746eb6a8b2..212ab0662c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CKnRParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CKnRParameter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.dom.parser.c;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTElaboratedTypeSpecifier;
@@ -123,7 +122,7 @@ public class CKnRParameter extends PlatformObject implements IParameter {
return Linkage.C_LINKAGE;
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return CVisitor.findEnclosingFunction(declaration);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CLabel.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CLabel.java
index aa8a72eddb..e2835fdb0a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CLabel.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CLabel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.dom.parser.c;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTLabelStatement;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
@@ -20,65 +19,60 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.ILabel;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.internal.core.dom.Linkage;
-import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
import org.eclipse.core.runtime.PlatformObject;
/**
* Represents a label.
*/
public class CLabel extends PlatformObject implements ILabel {
-
- public static class CLabelProblem extends ProblemBinding implements ILabel {
- public CLabelProblem(IASTNode node, int id, char[] arg) {
- super(node, id, arg);
- }
- public IASTLabelStatement getLabelStatement() throws DOMException {
- throw new DOMException(this);
- }
- }
-
- private final IASTName labelStatement;
-
- public CLabel(IASTName statement) {
- labelStatement = statement;
- statement.setBinding(this);
- }
+ private final IASTName labelStatement;
- public IASTNode getPhysicalNode() {
- return labelStatement;
- }
+ public CLabel(IASTName statement) {
+ labelStatement = statement;
+ statement.setBinding(this);
+ }
+
+ public IASTNode getPhysicalNode() {
+ return labelStatement;
+ }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.dom.ast.ILabel#getLabelStatement()
- */
- public IASTLabelStatement getLabelStatement() {
- return (IASTLabelStatement) labelStatement.getParent();
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.core.dom.ast.ILabel#getLabelStatement()
+ */
+ public IASTLabelStatement getLabelStatement() {
+ return (IASTLabelStatement) labelStatement.getParent();
+ }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
- */
- public String getName() {
- return labelStatement.toString();
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
+ */
+ public String getName() {
+ return labelStatement.toString();
+ }
- public char[] getNameCharArray() {
- return labelStatement.toCharArray();
- }
+ public char[] getNameCharArray() {
+ return labelStatement.toCharArray();
+ }
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
- */
- public IScope getScope() {
- return CVisitor.getContainingScope(labelStatement.getParent());
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
+ */
+ public IScope getScope() {
+ return CVisitor.getContainingScope(labelStatement.getParent());
+ }
- public ILinkage getLinkage() {
+ public ILinkage getLinkage() {
return Linkage.C_LINKAGE;
}
-
- public IBinding getOwner() throws DOMException {
+
+ public IBinding getOwner() {
return CVisitor.findEnclosingFunction(labelStatement);
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CParameter.java
index 6c8bc42758..4fac804d4c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CParameter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.dom.parser.c;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
@@ -38,151 +37,147 @@ import org.eclipse.core.runtime.PlatformObject;
* Represents the parameter of a function.
*/
public class CParameter extends PlatformObject implements IParameter {
- public static class CParameterProblem extends ProblemBinding implements IParameter {
- public CParameterProblem(IASTNode node, int id, char[] arg) {
- super(node, id, arg);
- }
- public IType getType() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isStatic() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isExtern() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isAuto() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isRegister() throws DOMException {
- throw new DOMException(this);
- }
- public IValue getInitialValue() {
- return null;
+ public static class CParameterProblem extends ProblemBinding implements IParameter {
+ public CParameterProblem(IASTNode node, int id, char[] arg) {
+ super(node, id, arg);
}
- }
-
+ }
+
private IASTName[] declarations;
private IType type = null;
-
+
public CParameter(IASTName parameterName) {
this.declarations = new IASTName[] { parameterName };
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.cdt.core.dom.ast.IVariable#getType()
*/
-
- public IType getType() {
+
+ public IType getType() {
if (type == null && declarations[0].getParent() instanceof IASTDeclarator)
- type = CVisitor.createType((IASTDeclarator)declarations[0].getParent());
-
+ type = CVisitor.createType((IASTDeclarator) declarations[0].getParent());
+
return type;
}
- private IASTName getPrimaryDeclaration() {
- if (declarations != null) {
- for (int i = 0; i < declarations.length && declarations[i] != null; i++) {
- IASTNode node = declarations[i].getParent();
- while (!(node instanceof IASTDeclaration))
- node = node.getParent();
-
- if (node.getPropertyInParent() == ICASTKnRFunctionDeclarator.FUNCTION_PARAMETER ||
- node instanceof IASTFunctionDefinition) {
- return declarations[i];
- }
- }
- return declarations[0];
- }
- return null;
- }
-
- /* (non-Javadoc)
+ private IASTName getPrimaryDeclaration() {
+ if (declarations != null) {
+ for (int i = 0; i < declarations.length && declarations[i] != null; i++) {
+ IASTNode node = declarations[i].getParent();
+ while (!(node instanceof IASTDeclaration))
+ node = node.getParent();
+
+ if (node.getPropertyInParent() == ICASTKnRFunctionDeclarator.FUNCTION_PARAMETER
+ || node instanceof IASTFunctionDefinition) {
+ return declarations[i];
+ }
+ }
+ return declarations[0];
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
*/
public String getName() {
- IASTName name = getPrimaryDeclaration();
- if (name != null)
- return name.toString();
- return CVisitor.EMPTY_STRING;
+ IASTName name = getPrimaryDeclaration();
+ if (name != null)
+ return name.toString();
+ return CVisitor.EMPTY_STRING;
}
public char[] getNameCharArray() {
- IASTName name = getPrimaryDeclaration();
- if (name != null)
- return name.toCharArray();
- return CVisitor.EMPTY_CHAR_ARRAY;
+ IASTName name = getPrimaryDeclaration();
+ if (name != null)
+ return name.toCharArray();
+ return CVisitor.EMPTY_CHAR_ARRAY;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
*/
public IScope getScope() {
- //IASTParameterDeclaration or IASTSimpleDeclaration
- for (int i = 0; i < declarations.length; i++) {
- IASTNode parent = declarations[i].getParent();
- if (parent instanceof ICASTKnRFunctionDeclarator) {
- parent = parent.getParent();
- return ((IASTCompoundStatement)((IASTFunctionDefinition) parent).getBody()).getScope();
- }
-
- IASTNode fdtorNode = parent.getParent().getParent();
- if (fdtorNode instanceof IASTFunctionDeclarator) {
- IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator) fdtorNode;
+ // IASTParameterDeclaration or IASTSimpleDeclaration
+ for (IASTName declaration : declarations) {
+ IASTNode parent = declaration.getParent();
+ if (parent instanceof ICASTKnRFunctionDeclarator) {
+ parent = parent.getParent();
+ return ((IASTCompoundStatement) ((IASTFunctionDefinition) parent).getBody()).getScope();
+ }
+
+ IASTNode fdtorNode = parent.getParent().getParent();
+ if (fdtorNode instanceof IASTFunctionDeclarator) {
+ IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator) fdtorNode;
parent = fdtor.getParent();
if (parent instanceof IASTFunctionDefinition) {
- return ((IASTCompoundStatement)((IASTFunctionDefinition) parent).getBody()).getScope();
+ return ((IASTCompoundStatement) ((IASTFunctionDefinition) parent).getBody()).getScope();
}
- }
- }
- //TODO: if not definition, find definition
+ }
+ }
+ // TODO: if not definition, find definition
return null;
}
- /**
- * @param name
- */
+ /**
+ * @param name
+ */
public void addDeclaration(IASTName name) {
if (name != null && name.isActive())
declarations = (IASTName[]) ArrayUtil.append(IASTName.class, declarations, name);
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.dom.ast.IVariable#isStatic()
- */
- public boolean isStatic() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.dom.ast.IVariable#isExtern()
- */
- public boolean isExtern() {
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.dom.ast.IVariable#isAuto()
- */
- public boolean isAuto() {
- return hasStorageClass(IASTDeclSpecifier.sc_auto);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.dom.ast.IVariable#isRegister()
- */
- public boolean isRegister() {
- return hasStorageClass(IASTDeclSpecifier.sc_register);
- }
-
- public boolean hasStorageClass(int storage) {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.core.dom.ast.IVariable#isStatic()
+ */
+ public boolean isStatic() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.core.dom.ast.IVariable#isExtern()
+ */
+ public boolean isExtern() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.core.dom.ast.IVariable#isAuto()
+ */
+ public boolean isAuto() {
+ return hasStorageClass(IASTDeclSpecifier.sc_auto);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.core.dom.ast.IVariable#isRegister()
+ */
+ public boolean isRegister() {
+ return hasStorageClass(IASTDeclSpecifier.sc_register);
+ }
+
+ public boolean hasStorageClass(int storage) {
if (declarations == null)
return false;
-
+
for (int i = 0; i < declarations.length && declarations[i] != null; i++) {
- IASTNode parent= declarations[i].getParent();
+ IASTNode parent = declarations[i].getParent();
while (!(parent instanceof IASTParameterDeclaration) && !(parent instanceof IASTDeclaration))
- parent= parent.getParent();
+ parent = parent.getParent();
IASTDeclSpecifier declSpec = null;
if (parent instanceof IASTSimpleDeclaration) {
@@ -195,15 +190,15 @@ public class CParameter extends PlatformObject implements IParameter {
}
return false;
}
-
+
public ILinkage getLinkage() {
return Linkage.C_LINKAGE;
}
-
- public IBinding getOwner() throws DOMException {
+
+ public IBinding getOwner() {
if (declarations == null || declarations.length == 0)
return null;
-
+
return CVisitor.findEnclosingFunction(declarations[0]);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java
index 48cc051427..1f3ca719b5 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CScope.java
@@ -17,7 +17,7 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.IName;
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
-import org.eclipse.cdt.core.dom.ast.DOMException;
+import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
@@ -27,6 +27,7 @@ import org.eclipse.cdt.core.dom.ast.IASTDeclarationStatement;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier;
+import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
import org.eclipse.cdt.core.dom.ast.IASTForStatement;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
@@ -44,8 +45,6 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IEnumeration;
import org.eclipse.cdt.core.dom.ast.IScope;
-import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
-import org.eclipse.cdt.core.dom.ast.c.CASTVisitor;
import org.eclipse.cdt.core.dom.ast.c.ICASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.c.ICASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.c.ICASTEnumerationSpecifier;
@@ -129,7 +128,7 @@ public class CScope implements ICScope, IASTInternalScope {
return CVisitor.getContainingScope( physicalNode );
}
- protected static class CollectNamesAction extends CASTVisitor {
+ protected static class CollectNamesAction extends ASTVisitor {
private char [] name;
private IASTName [] result = null;
CollectNamesAction( char [] n ){
@@ -163,7 +162,7 @@ public class CScope implements ICScope, IASTInternalScope {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#find(java.lang.String)
*/
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
return CVisitor.findBindings(this, name);
}
@@ -235,7 +234,7 @@ public class CScope implements ICScope, IASTInternalScope {
return getBinding(name, resolve, IIndexFileSet.EMPTY);
}
- public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) throws DOMException {
+ public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) {
return getBindings(name, resolve, prefix, IIndexFileSet.EMPTY);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructure.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructure.java
index 76faee9883..bc7810c1c4 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructure.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CStructure.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -45,25 +45,26 @@ import org.eclipse.core.runtime.PlatformObject;
* Represents structs and unions.
*/
public class CStructure extends PlatformObject implements ICompositeType, ICInternalBinding {
-
+
public static class CStructureProblem extends ProblemBinding implements ICompositeType {
public CStructureProblem(IASTNode node, int id, char[] arg) {
super(node, id, arg);
}
- public IField findField(String name) throws DOMException {
- throw new DOMException(this);
- }
- public IScope getCompositeScope() throws DOMException {
- throw new DOMException(this);
+
+ public IField findField(String name) {
+ return null;
}
- public IField[] getFields() throws DOMException {
- throw new DOMException(this);
+
+ public IScope getCompositeScope() {
+ return this;
}
- public int getKey() throws DOMException {
- throw new DOMException(this);
+
+ public IField[] getFields() {
+ return IField.EMPTY_FIELD_ARRAY;
}
- public boolean isAnonymous() throws DOMException {
- throw new DOMException(this);
+
+ public int getKey() {
+ return k_struct;
}
}
@@ -71,20 +72,20 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
private IASTName definition;
private boolean checked;
private ICompositeType typeInIndex;
-
+
public CStructure(IASTName name) {
- if (name.getPropertyInParent() == IASTCompositeTypeSpecifier.TYPE_NAME) {
- definition = name;
- } else {
- declarations = new IASTName[] { name };
- }
- name.setBinding(this);
+ if (name.getPropertyInParent() == IASTCompositeTypeSpecifier.TYPE_NAME) {
+ definition = name;
+ } else {
+ declarations = new IASTName[] { name };
+ }
+ name.setBinding(this);
+ }
+
+ public IASTNode getPhysicalNode() {
+ return (definition != null) ? (IASTNode) definition : (IASTNode) declarations[0];
}
-
- public IASTNode getPhysicalNode() {
- return (definition != null) ? (IASTNode)definition : (IASTNode)declarations[0];
- }
-
+
private void checkForDefinition() {
if (!checked && definition == null) {
IASTNode declSpec = declarations[0].getParent();
@@ -92,23 +93,25 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
IASTDeclSpecifier spec = CVisitor.findDefinition((ICASTElaboratedTypeSpecifier) declSpec);
if (spec instanceof ICASTCompositeTypeSpecifier) {
ICASTCompositeTypeSpecifier compTypeSpec = (ICASTCompositeTypeSpecifier) spec;
- definition= compTypeSpec.getName();
+ definition = compTypeSpec.getName();
definition.setBinding(this);
}
}
if (definition == null && typeInIndex == null) {
final IASTTranslationUnit translationUnit = declSpec.getTranslationUnit();
- IIndex index= translationUnit.getIndex();
+ IIndex index = translationUnit.getIndex();
if (index != null) {
- typeInIndex= (ICompositeType) index.adaptBinding(this);
+ typeInIndex = (ICompositeType) index.adaptBinding(this);
}
}
}
checked = true;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
*/
public String getName() {
@@ -117,6 +120,7 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
return declarations[0].toString();
}
+
public char[] getNameCharArray() {
if (definition != null)
return definition.toCharArray();
@@ -124,29 +128,33 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
return declarations[0].toCharArray();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
*/
public IScope getScope() throws DOMException {
- IASTDeclSpecifier declSpec = (IASTDeclSpecifier) ((definition != null) ? (IASTNode)definition.getParent() : declarations[0].getParent());
+ IASTDeclSpecifier declSpec = (IASTDeclSpecifier) ((definition != null) ? (IASTNode) definition
+ .getParent() : declarations[0].getParent());
IScope scope = CVisitor.getContainingScope(declSpec);
- while(scope instanceof ICCompositeTypeScope) {
+ while (scope instanceof ICCompositeTypeScope) {
scope = scope.getParent();
}
return scope;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.cdt.core.dom.ast.ICompositeType#getFields()
*/
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
checkForDefinition();
if (definition == null) {
- return new IField[] {
- new CField.CFieldProblem(declarations[0], IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, getNameCharArray())
- };
+ return new IField[] { new CField.CFieldProblem(this, declarations[0],
+ IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, getNameCharArray()) };
}
- ICASTCompositeTypeSpecifier compSpec = (ICASTCompositeTypeSpecifier) definition.getParent();
+ ICASTCompositeTypeSpecifier compSpec = (ICASTCompositeTypeSpecifier) definition.getParent();
IField[] fields = collectFields(compSpec, null);
return (IField[]) ArrayUtil.trim(IField.class, fields);
}
@@ -162,7 +170,7 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
if (declarators.length == 0) {
IASTDeclSpecifier declspec = ((IASTSimpleDeclaration) node).getDeclSpecifier();
if (declspec instanceof ICASTCompositeTypeSpecifier) {
- fields= collectFields((ICASTCompositeTypeSpecifier) declspec, fields);
+ fields = collectFields((ICASTCompositeTypeSpecifier) declspec, fields);
}
} else {
for (IASTDeclarator declarator : declarators) {
@@ -178,10 +186,11 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
return fields;
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
IScope scope = getCompositeScope();
if (scope == null) {
- return new CField.CFieldProblem(declarations[0], IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, getNameCharArray());
+ return new CField.CFieldProblem(this, declarations[0],
+ IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, getNameCharArray());
}
final CASTName astName = new CASTName(name.toCharArray());
@@ -189,49 +198,49 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
IBinding binding = scope.getBinding(astName, true);
if (binding instanceof IField)
return (IField) binding;
-
+
return null;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.cdt.core.dom.ast.ICompositeType#getKey()
*/
public int getKey() {
- return (definition != null) ? ((IASTCompositeTypeSpecifier)definition.getParent()).getKey()
- : ((IASTElaboratedTypeSpecifier)declarations[0].getParent()).getKind();
+ return (definition != null) ? ((IASTCompositeTypeSpecifier) definition.getParent()).getKey()
+ : ((IASTElaboratedTypeSpecifier) declarations[0].getParent()).getKind();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.cdt.core.dom.ast.ICompositeType#getCompositeScope()
*/
public IScope getCompositeScope() {
checkForDefinition();
if (definition != null) {
- return ((IASTCompositeTypeSpecifier)definition.getParent()).getScope();
+ return ((IASTCompositeTypeSpecifier) definition.getParent()).getScope();
}
// fwd-declarations must be backed up from the index
if (typeInIndex != null) {
- try {
- IScope scope = typeInIndex.getCompositeScope();
- if (scope instanceof ICCompositeTypeScope)
- return scope;
- } catch (DOMException e) {
- // index bindings don't throw DOMExeptions.
- }
+ IScope scope = typeInIndex.getCompositeScope();
+ if (scope instanceof ICCompositeTypeScope)
+ return scope;
}
return null;
}
-
- @Override
+
+ @Override
public Object clone() {
- IType t = null;
- try {
- t = (IType) super.clone();
- } catch (CloneNotSupportedException e) {
- //not going to happen
- }
- return t;
- }
+ IType t = null;
+ try {
+ t = (IType) super.clone();
+ } catch (CloneNotSupportedException e) {
+ // not going to happen
+ }
+ return t;
+ }
public void addDefinition(ICASTCompositeTypeSpecifier compositeTypeSpec) {
if (compositeTypeSpec.isActive()) {
@@ -239,7 +248,7 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
compositeTypeSpec.getName().setBinding(this);
}
}
-
+
public void addDeclaration(IASTName decl) {
if (!decl.isActive() || decl.getPropertyInParent() != IASTElaboratedTypeSpecifier.TYPE_NAME)
return;
@@ -249,18 +258,19 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
declarations = new IASTName[] { decl };
return;
}
- IASTName first= declarations[0];
+ IASTName first = declarations[0];
if (((ASTNode) first).getOffset() > ((ASTNode) decl).getOffset()) {
- declarations[0]= decl;
- decl= first;
+ declarations[0] = decl;
+ decl = first;
}
- declarations= (IASTName[]) ArrayUtil.append(IASTName.class, declarations, decl);
+ declarations = (IASTName[]) ArrayUtil.append(IASTName.class, declarations, decl);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType)
- */
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.core.dom.ast.IType#isSameType(org.eclipse.cdt.core.dom.ast.IType)
+ */
public boolean isSameType(IType type) {
if (type == this)
return true;
@@ -268,7 +278,7 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
return type.isSameType(this);
return false;
}
-
+
public ILinkage getLinkage() {
return Linkage.C_LINKAGE;
}
@@ -280,31 +290,31 @@ public class CStructure extends PlatformObject implements ICompositeType, ICInte
public IASTNode getDefinition() {
return definition;
}
-
- public IBinding getOwner() throws DOMException {
- IASTNode node= definition;
+
+ public IBinding getOwner() {
+ IASTNode node = definition;
if (node == null) {
- if (declarations != null && declarations.length > 0) {
- node= declarations[0];
+ if (declarations != null && declarations.length > 0) {
+ node = declarations[0];
}
}
- IBinding result= CVisitor.findEnclosingFunction(node); // local or global
+ IBinding result = CVisitor.findEnclosingFunction(node); // local or global
if (result != null)
return result;
-
+
if (definition != null && isAnonymous()) {
return CVisitor.findDeclarationOwner(definition, false);
}
return null;
}
-
- public boolean isAnonymous() throws DOMException {
- if (getNameCharArray().length > 0 || definition == null)
+
+ public boolean isAnonymous() {
+ if (getNameCharArray().length > 0 || definition == null)
return false;
-
- IASTCompositeTypeSpecifier spec= ((IASTCompositeTypeSpecifier)definition.getParent());
+
+ IASTCompositeTypeSpecifier spec = ((IASTCompositeTypeSpecifier) definition.getParent());
if (spec != null) {
- IASTNode node= spec.getParent();
+ IASTNode node = spec.getParent();
if (node instanceof IASTSimpleDeclaration) {
if (((IASTSimpleDeclaration) node).getDeclarators().length == 0) {
return true;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CTypedef.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CTypedef.java
index a622fbe2f0..33d2115f1d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CTypedef.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CTypedef.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.dom.parser.c;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
@@ -111,7 +110,7 @@ public class CTypedef extends PlatformObject implements ITypedef, ITypeContainer
return name;
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return CVisitor.findEnclosingFunction(name);
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVariable.java
index d38d0ee63d..68bd320021 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVariable.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVariable.java
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.dom.parser.c;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@@ -40,39 +39,22 @@ import org.eclipse.core.runtime.PlatformObject;
* Binding for a global or a local variable, serves as base class for fields.
*/
public class CVariable extends PlatformObject implements IInternalVariable, ICInternalBinding {
- public static class CVariableProblem extends ProblemBinding implements IVariable {
- public CVariableProblem(IASTNode node, int id, char[] arg) {
- super(node, id, arg);
- }
-
- public IType getType() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isStatic() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isExtern() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isAuto() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isRegister() throws DOMException {
- throw new DOMException(this);
- }
- public IValue getInitialValue() {
- return null;
+ public static class CVariableProblem extends ProblemBinding implements IVariable {
+ public CVariableProblem(IASTNode node, int id, char[] arg) {
+ super(node, id, arg);
}
- }
+ }
+
private IASTName[] declarations = null;
private IType type = null;
-
+
public CVariable(IASTName name) {
declarations = new IASTName[] { name };
}
- public IASTNode getPhysicalNode() {
- return declarations[0];
- }
+
+ public IASTNode getPhysicalNode() {
+ return declarations[0];
+ }
public void addDeclaration(IASTName name) {
if (name != null && name.isActive()) {
@@ -80,16 +62,20 @@ public class CVariable extends PlatformObject implements IInternalVariable, ICIn
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.cdt.core.dom.ast.IVariable#getType()
*/
public IType getType() {
if (type == null && declarations[0].getParent() instanceof IASTDeclarator)
- type = CVisitor.createType((IASTDeclarator)declarations[0].getParent());
+ type = CVisitor.createType((IASTDeclarator) declarations[0].getParent());
return type;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.cdt.core.dom.ast.IBinding#getName()
*/
public String getName() {
@@ -97,10 +83,12 @@ public class CVariable extends PlatformObject implements IInternalVariable, ICIn
}
public char[] getNameCharArray() {
- return declarations[0].toCharArray();
+ return declarations[0].toCharArray();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.cdt.core.dom.ast.IBinding#getScope()
*/
public IScope getScope() {
@@ -108,109 +96,116 @@ public class CVariable extends PlatformObject implements IInternalVariable, ICIn
return CVisitor.getContainingScope(declarator.getParent());
}
- public boolean isStatic() {
+ public boolean isStatic() {
return hasStorageClass(IASTDeclSpecifier.sc_static);
}
- public boolean hasStorageClass(int storage) {
- if (declarations == null)
- return false;
-
- for (int i = 0; i < declarations.length && declarations[i] != null; i++) {
- final IASTName name = declarations[i];
+ public boolean hasStorageClass(int storage) {
+ if (declarations == null)
+ return false;
+
+ for (int i = 0; i < declarations.length && declarations[i] != null; i++) {
+ final IASTName name = declarations[i];
IASTNode parent = name.getParent();
- while (!(parent instanceof IASTDeclaration))
- parent = parent.getParent();
-
- if (parent instanceof IASTSimpleDeclaration) {
- IASTDeclSpecifier declSpec = ((IASTSimpleDeclaration) parent).getDeclSpecifier();
- if (declSpec.getStorageClass() == storage) {
- return true;
- }
- }
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.dom.ast.IVariable#isExtern()
- */
- public boolean isExtern() {
- return hasStorageClass(IASTDeclSpecifier.sc_extern);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.dom.ast.IVariable#isAuto()
- */
- public boolean isAuto() {
- return hasStorageClass(IASTDeclSpecifier.sc_auto);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.cdt.core.dom.ast.IVariable#isRegister()
- */
- public boolean isRegister() {
- return hasStorageClass(IASTDeclSpecifier.sc_register);
- }
-
- public ILinkage getLinkage() {
+ while (!(parent instanceof IASTDeclaration))
+ parent = parent.getParent();
+
+ if (parent instanceof IASTSimpleDeclaration) {
+ IASTDeclSpecifier declSpec = ((IASTSimpleDeclaration) parent).getDeclSpecifier();
+ if (declSpec.getStorageClass() == storage) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.core.dom.ast.IVariable#isExtern()
+ */
+ public boolean isExtern() {
+ return hasStorageClass(IASTDeclSpecifier.sc_extern);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.core.dom.ast.IVariable#isAuto()
+ */
+ public boolean isAuto() {
+ return hasStorageClass(IASTDeclSpecifier.sc_auto);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.cdt.core.dom.ast.IVariable#isRegister()
+ */
+ public boolean isRegister() {
+ return hasStorageClass(IASTDeclSpecifier.sc_register);
+ }
+
+ public ILinkage getLinkage() {
return Linkage.C_LINKAGE;
}
- public IASTNode[] getDeclarations() {
+ public IASTNode[] getDeclarations() {
return declarations;
}
- public IASTNode getDefinition() {
+ public IASTNode getDefinition() {
return getPhysicalNode();
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
if (declarations == null || declarations.length == 0)
return null;
-
+
return CVisitor.findDeclarationOwner(declarations[0], true);
}
-
+
public IValue getInitialValue() {
return getInitialValue(Value.MAX_RECURSION_DEPTH);
}
-
+
public IValue getInitialValue(int maxDepth) {
if (declarations != null) {
for (IASTName decl : declarations) {
if (decl == null)
break;
- final IValue val= getInitialValue(decl, maxDepth);
+ final IValue val = getInitialValue(decl, maxDepth);
if (val != null)
return val;
}
- }
+ }
return null;
}
-
+
private IValue getInitialValue(IASTName name, int maxDepth) {
- IASTDeclarator dtor= findDeclarator(name);
+ IASTDeclarator dtor = findDeclarator(name);
if (dtor != null) {
- IASTInitializer init= dtor.getInitializer();
+ IASTInitializer init = dtor.getInitializer();
if (init instanceof IASTEqualsInitializer) {
- final IASTInitializerClause initClause = ((IASTEqualsInitializer) init).getInitializerClause();
+ final IASTInitializerClause initClause = ((IASTEqualsInitializer) init)
+ .getInitializerClause();
if (initClause instanceof IASTExpression) {
return Value.create((IASTExpression) initClause, maxDepth);
}
- }
+ }
if (init != null)
return Value.UNKNOWN;
}
return null;
}
-
+
private IASTDeclarator findDeclarator(IASTName name) {
- IASTNode node = name.getParent();
- if (!(node instanceof IASTDeclarator))
- return null;
+ IASTNode node = name.getParent();
+ if (!(node instanceof IASTDeclarator))
+ return null;
- return ASTQueries.findOutermostDeclarator((IASTDeclarator) node);
- }
+ return ASTQueries.findOutermostDeclarator((IASTDeclarator) node);
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java
index f9ad8d19bd..bab4ffcf75 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CVisitor.java
@@ -17,6 +17,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
+import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
@@ -69,7 +70,6 @@ import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.IVariable;
-import org.eclipse.cdt.core.dom.ast.c.CASTVisitor;
import org.eclipse.cdt.core.dom.ast.c.ICASTArrayModifier;
import org.eclipse.cdt.core.dom.ast.c.ICASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.c.ICASTDeclSpecifier;
@@ -99,7 +99,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
* Collection of methods to find information in an AST.
*/
public class CVisitor extends ASTQueries {
- public static class CollectProblemsAction extends CASTVisitor {
+ public static class CollectProblemsAction extends ASTVisitor {
{
shouldVisitDeclarations = true;
shouldVisitExpressions = true;
@@ -188,7 +188,7 @@ public class CVisitor extends ASTQueries {
}
}
- public static class CollectDeclarationsAction extends CASTVisitor {
+ public static class CollectDeclarationsAction extends ASTVisitor {
{
shouldVisitDeclarators = true;
shouldVisitDeclSpecifiers = true;
@@ -341,7 +341,7 @@ public class CVisitor extends ASTQueries {
}
}
- public static class CollectReferencesAction extends CASTVisitor {
+ public static class CollectReferencesAction extends ASTVisitor {
private static final int DEFAULT_LIST_SIZE = 8;
private IASTName[] refs;
private IBinding binding;
@@ -476,10 +476,7 @@ public class CVisitor extends ASTQueries {
IScope scope = getContainingScope(enumeration);
IBinding binding= null;
if (scope != null) {
- try {
- binding = scope.getBinding(name, false);
- } catch (DOMException e) {
- }
+ binding = scope.getBinding(name, false);
}
if (binding != null && !(binding instanceof IIndexBinding) && name.isActive()) {
if (binding instanceof IEnumeration) {
@@ -516,7 +513,7 @@ public class CVisitor extends ASTQueries {
}
}
//label not found
- return new CLabel.CLabelProblem(((IASTGotoStatement)statement).getName(), IProblemBinding.SEMANTIC_LABEL_STATEMENT_NOT_FOUND, gotoName);
+ return new ProblemBinding(((IASTGotoStatement)statement).getName(), IProblemBinding.SEMANTIC_LABEL_STATEMENT_NOT_FOUND, gotoName);
}
} else if (statement instanceof IASTLabelStatement) {
IASTName name = ((IASTLabelStatement)statement).getName();
@@ -558,16 +555,13 @@ public class CVisitor extends ASTQueries {
binding= resolveBinding(elabTypeSpec);
if (binding == null) {
insertIntoScope= elabTypeSpec.getTranslationUnit().getScope();
- try {
- binding= insertIntoScope.getBinding(name, false);
- if (binding != null && name.isActive()) {
- if (binding instanceof CEnumeration) {
- ((CEnumeration)binding).addDeclaration(name);
- } else if (binding instanceof CStructure) {
- ((CStructure) binding).addDeclaration(name);
- }
- }
- } catch (DOMException e) {
+ binding= insertIntoScope.getBinding(name, false);
+ if (binding != null && name.isActive()) {
+ if (binding instanceof CEnumeration) {
+ ((CEnumeration)binding).addDeclaration(name);
+ } else if (binding instanceof CStructure) {
+ ((CStructure) binding).addDeclaration(name);
+ }
}
}
}
@@ -612,41 +606,30 @@ public class CVisitor extends ASTQueries {
}
if (prefix) {
IBinding[] result = null;
- try {
- char[] p = fieldReference.getFieldName().toCharArray();
- IField[] fields = ((ICompositeType) type).getFields();
- for (IField field : fields) {
- if (CharArrayUtils.equals(field.getNameCharArray(), 0, p.length, p, true)) {
- result = (IBinding[]) ArrayUtil.append(IBinding.class, result, field);
- }
- }
- return ArrayUtil.trim(IBinding.class, result);
- } catch (DOMException e) {
- return new IBinding[] { e.getProblem() };
- }
+ char[] p = fieldReference.getFieldName().toCharArray();
+ IField[] fields = ((ICompositeType) type).getFields();
+ for (IField field : fields) {
+ if (CharArrayUtils.equals(field.getNameCharArray(), 0, p.length, p, true)) {
+ result = (IBinding[]) ArrayUtil.append(IBinding.class, result, field);
+ }
+ }
+ return ArrayUtil.trim(IBinding.class, result);
}
- try {
- return ((ICompositeType) type).findField(fieldReference.getFieldName().toString());
- } catch (DOMException e) {
- return e.getProblem();
- }
+ return ((ICompositeType) type).findField(fieldReference.getFieldName().toString());
}
return null;
}
static IType getPtrDiffType(IASTBinaryExpression expr) {
IScope scope = getContainingScope(expr);
- try {
- IBinding[] bs = scope.find(PTRDIFF_T);
- for (IBinding b : bs) {
- if (b instanceof IType) {
- if (b instanceof ICInternalBinding == false ||
- CVisitor.declaredBefore(((ICInternalBinding) b).getPhysicalNode(), expr)) {
- return (IType) b;
- }
+ IBinding[] bs = scope.find(PTRDIFF_T);
+ for (IBinding b : bs) {
+ if (b instanceof IType) {
+ if (b instanceof ICInternalBinding == false ||
+ CVisitor.declaredBefore(((ICInternalBinding) b).getPhysicalNode(), expr)) {
+ return (IType) b;
}
}
- } catch (DOMException e) {
}
return new CBasicType(Kind.eInt, 0, expr);
@@ -654,17 +637,14 @@ public class CVisitor extends ASTQueries {
static IType getSize_T(IASTExpression expr) {
IScope scope = getContainingScope(expr);
- try {
- IBinding[] bs = scope.find(SIZE_T);
- for (IBinding b : bs) {
- if (b instanceof IType) {
- if (b instanceof ICInternalBinding == false ||
- CVisitor.declaredBefore(((ICInternalBinding) b).getPhysicalNode(), expr)) {
- return (IType) b;
- }
+ IBinding[] bs = scope.find(SIZE_T);
+ for (IBinding b : bs) {
+ if (b instanceof IType) {
+ if (b instanceof ICInternalBinding == false ||
+ CVisitor.declaredBefore(((ICInternalBinding) b).getPhysicalNode(), expr)) {
+ return (IType) b;
}
}
- } catch (DOMException e) {
}
return new CBasicType(Kind.eInt, IBasicType.IS_LONG | IBasicType.IS_UNSIGNED);
}
@@ -685,10 +665,7 @@ public class CVisitor extends ASTQueries {
if (declarator instanceof ICASTKnRFunctionDeclarator) {
if (CharArrayUtils.equals(declarator.getName().toCharArray(), name.toCharArray())) {
IScope scope= CVisitor.getContainingScope(declarator);
- try {
- binding = scope.getBinding(name, false);
- } catch (DOMException e) {
- }
+ binding = scope.getBinding(name, false);
if (binding != null && !(binding instanceof IIndexBinding) && name.isActive()) {
if (binding instanceof ICInternalFunction)
((ICInternalFunction)binding).addDeclarator(declarator);
@@ -725,11 +702,7 @@ public class CVisitor extends ASTQueries {
IASTName name = declarator.getName();
- IBinding binding = null;
- try {
- binding = (scope != null) ? scope.getBinding(name, false) : null;
- } catch (DOMException e1) {
- }
+ IBinding binding = (scope != null) ? scope.getBinding(name, false) : null;
boolean isFunction= false;
if (parent instanceof IASTParameterDeclaration || parent.getPropertyInParent() == ICASTKnRFunctionDeclarator.FUNCTION_PARAMETER) {
@@ -830,51 +803,31 @@ public class CVisitor extends ASTQueries {
IASTFunctionDeclarator functionDeclartor = functionDef.getDeclarator();
IASTName name = findInnermostDeclarator(functionDeclartor).getName();
IScope scope = getContainingScope(node);
- try {
- return lookup(scope, name);
- } catch (DOMException e) {
- return null;
- }
+ return lookup(scope, name);
} else if (node instanceof IASTIdExpression) {
IScope scope = getContainingScope(node);
- try {
- IBinding binding = lookup(scope, ((IASTIdExpression) node).getName());
- if (binding instanceof IType && !(binding instanceof IProblemBinding) ) {
- return new ProblemBinding(node, IProblemBinding.SEMANTIC_INVALID_TYPE,
- binding.getNameCharArray(), new IBinding[] { binding });
- }
- return binding;
- } catch (DOMException e) {
- return null;
- }
+ IBinding binding = lookup(scope, ((IASTIdExpression) node).getName());
+ if (binding instanceof IType && !(binding instanceof IProblemBinding) ) {
+ return new ProblemBinding(node, IProblemBinding.SEMANTIC_INVALID_TYPE,
+ binding.getNameCharArray(), new IBinding[] { binding });
+ }
+ return binding;
} else if (node instanceof ICASTTypedefNameSpecifier) {
IScope scope = getContainingScope(node);
- try {
- IASTName name= ((ICASTTypedefNameSpecifier) node).getName();
- IBinding binding = lookup(scope, name);
- if (binding == null)
- return new ProblemBinding(node, IProblemBinding.SEMANTIC_NAME_NOT_FOUND, name.toCharArray());
- if (binding instanceof IType)
- return binding;
- return new ProblemBinding(node, IProblemBinding.SEMANTIC_INVALID_TYPE, binding.getNameCharArray(),
- new IBinding[] { binding });
- } catch (DOMException e) {
- return null;
- }
+ IASTName name= ((ICASTTypedefNameSpecifier) node).getName();
+ IBinding binding = lookup(scope, name);
+ if (binding == null)
+ return new ProblemBinding(node, IProblemBinding.SEMANTIC_NAME_NOT_FOUND, name.toCharArray());
+ if (binding instanceof IType)
+ return binding;
+ return new ProblemBinding(node, IProblemBinding.SEMANTIC_INVALID_TYPE, binding.getNameCharArray(),
+ new IBinding[] { binding });
} else if (node instanceof ICASTElaboratedTypeSpecifier) {
IScope scope = getContainingScope(node);
- try {
- return lookup(scope, ((ICASTElaboratedTypeSpecifier) node).getName());
- } catch (DOMException e) {
- return null;
- }
+ return lookup(scope, ((ICASTElaboratedTypeSpecifier) node).getName());
} else if (node instanceof ICASTCompositeTypeSpecifier) {
IScope scope = getContainingScope(node);
- try {
- return lookup(scope, ((ICASTCompositeTypeSpecifier)node).getName());
- } catch (DOMException e) {
- return null;
- }
+ return lookup(scope, ((ICASTCompositeTypeSpecifier)node).getName());
} else if (node instanceof IASTTypeId) {
IASTTypeId typeId = (IASTTypeId) node;
IASTDeclSpecifier declSpec = typeId.getDeclSpecifier();
@@ -919,11 +872,7 @@ public class CVisitor extends ASTQueries {
struct = ((IASTCompositeTypeSpecifier)simpleDecl.getDeclSpecifier()).getName().resolveBinding();
if (struct instanceof CStructure) {
- try {
- return ((CStructure)struct).findField(((ICASTFieldDesignator)node).getName().toString());
- } catch (DOMException e) {
- return e.getProblem();
- }
+ return ((CStructure)struct).findField(((ICASTFieldDesignator)node).getName().toString());
} else if (struct instanceof ITypeContainer) {
IType type;
type = ((ITypeContainer)struct).getType();
@@ -933,11 +882,7 @@ public class CVisitor extends ASTQueries {
if (type instanceof CStructure)
- try {
- return ((CStructure)type).findField(((ICASTFieldDesignator)node).getName().toString());
- } catch (DOMException e1) {
- return e1.getProblem();
- }
+ return ((CStructure)type).findField(((ICASTFieldDesignator)node).getName().toString());
}
}
}
@@ -1069,7 +1014,7 @@ public class CVisitor extends ASTQueries {
/**
* Lookup for a name starting from the given scope.
*/
- protected static IBinding lookup(IScope scope, IASTName name) throws DOMException{
+ protected static IBinding lookup(IScope scope, IASTName name) {
if (scope == null)
return null;
@@ -1086,15 +1031,16 @@ public class CVisitor extends ASTQueries {
}
while (scope != null) {
+ if (!(scope instanceof ICCompositeTypeScope)) {
+ IBinding binding = scope.getBinding(name, true, fileSet);
+ if (binding != null)
+ return binding;
+ }
try {
- if (!(scope instanceof ICCompositeTypeScope)) {
- IBinding binding = scope.getBinding(name, true, fileSet);
- if (binding != null)
- return binding;
- }
+ scope= scope.getParent();
} catch (DOMException e) {
+ scope= null;
}
- scope= scope.getParent();
}
return externalBinding(tu, name);
@@ -1123,23 +1069,20 @@ public class CVisitor extends ASTQueries {
IBinding[] result = null;
CharArraySet handled= new CharArraySet(1);
while (scope != null) {
- try {
- if (!(scope instanceof ICCompositeTypeScope)) {
- IBinding[] bindings= scope.getBindings(name, true, true, fileSet);
- for (IBinding b : bindings) {
- final char[] n= b.getNameCharArray();
- // consider binding only if no binding with the same name was found in another scope.
- if (!handled.containsKey(n)) {
- result= (IBinding[]) ArrayUtil.append(IBinding.class, result, b);
- }
- }
- // store names of bindings
- for (IBinding b : bindings) {
- final char[] n= b.getNameCharArray();
- handled.put(n);
+ if (!(scope instanceof ICCompositeTypeScope)) {
+ IBinding[] bindings= scope.getBindings(name, true, true, fileSet);
+ for (IBinding b : bindings) {
+ final char[] n= b.getNameCharArray();
+ // consider binding only if no binding with the same name was found in another scope.
+ if (!handled.containsKey(n)) {
+ result= (IBinding[]) ArrayUtil.append(IBinding.class, result, b);
}
}
- } catch (DOMException e) {
+ // store names of bindings
+ for (IBinding b : bindings) {
+ final char[] n= b.getNameCharArray();
+ handled.put(n);
+ }
}
scope= scope.getParent();
}
@@ -1534,7 +1477,7 @@ public class CVisitor extends ASTQueries {
return (IBinding[]) ArrayUtil.trim(IBinding.class, result);
}
- public static IBinding[] findBindings(IScope scope, String name) throws DOMException {
+ public static IBinding[] findBindings(IScope scope, String name) {
CASTName astName = new CASTName(name.toCharArray());
//normal names
@@ -1573,7 +1516,11 @@ public class CVisitor extends ASTQueries {
}
break;
}
- scope = scope.getParent();
+ try {
+ scope = scope.getParent();
+ } catch (DOMException e) {
+ scope= null;
+ }
} while (scope != null);
int c = (b1 == null ? 0 : b1.length) + (b2 == null ? 0 : b2.length) + b3.size();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/ICInternalBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/ICInternalBinding.java
index 36b24a1e76..06adeb95f7 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/ICInternalBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/ICInternalBinding.java
@@ -1,26 +1,21 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * Andrew Niefer (IBM Rational Software) - Initial API and implementation
*******************************************************************************/
-
-/*
- * Created on Jan 24, 2005
- */
package org.eclipse.cdt.internal.core.dom.parser.c;
import org.eclipse.cdt.core.dom.ast.IASTNode;
/**
- * @author aniefer
+ * Methods needed by CVisitor but not meant for public interface
*/
public interface ICInternalBinding {
- //methods needed by CVisitor but not meant for public interface
public IASTNode getPhysicalNode();
/**
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/AbstractCPPClassSpecializationScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/AbstractCPPClassSpecializationScope.java
index 815c7a67c6..e8c7d3f2bc 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/AbstractCPPClassSpecializationScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/AbstractCPPClassSpecializationScope.java
@@ -54,15 +54,15 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat
return specialClass.getSpecializedBinding();
}
- public final IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
+ public final IBinding getBinding(IASTName name, boolean resolve) {
return getBinding(name, resolve, IIndexFileSet.EMPTY);
}
- public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) throws DOMException {
+ public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) {
return getBindings(name, resolve, prefix, IIndexFileSet.EMPTY);
}
- public IBinding getBinding(IASTName name, boolean forceResolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean forceResolve, IIndexFileSet fileSet) {
char[] c = name.getLookupKey();
if (CharArrayUtils.equals(c, specialClass.getNameCharArray())
@@ -86,12 +86,12 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat
}
final public IBinding[] getBindings(IASTName name, boolean forceResolve, boolean prefixLookup,
- IIndexFileSet fileSet) throws DOMException {
+ IIndexFileSet fileSet) {
return getBindings(name, forceResolve, prefixLookup, fileSet, true);
}
public IBinding[] getBindings(IASTName name, boolean forceResolve, boolean prefixLookup,
- IIndexFileSet fileSet, boolean checkPointOfDecl) throws DOMException {
+ IIndexFileSet fileSet, boolean checkPointOfDecl) {
ICPPClassType specialized = specialClass.getSpecializedBinding();
IScope classScope = specialized.getCompositeScope();
if (classScope == null)
@@ -119,7 +119,7 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat
return specialClass;
}
- public ICPPBase[] getBases() throws DOMException {
+ public ICPPBase[] getBases() {
if (fBases == null) {
ICPPBase[] result = null;
ICPPBase[] bases = specialClass.getSpecializedBinding().getBases();
@@ -175,22 +175,18 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat
return newArray;
}
- public ICPPField[] getDeclaredFields() throws DOMException {
+ public ICPPField[] getDeclaredFields() {
ICPPField[] fields= specialClass.getSpecializedBinding().getDeclaredFields();
return specializeMembers(fields);
}
public ICPPMethod[] getImplicitMethods() {
- try {
- ICPPClassScope origClassScope= (ICPPClassScope) specialClass.getSpecializedBinding().getCompositeScope();
- if (origClassScope == null) {
- return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
- }
- ICPPMethod[] methods= origClassScope.getImplicitMethods();
- return specializeMembers(methods);
- } catch (DOMException e) {
+ ICPPClassScope origClassScope= (ICPPClassScope) specialClass.getSpecializedBinding().getCompositeScope();
+ if (origClassScope == null) {
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
}
+ ICPPMethod[] methods= origClassScope.getImplicitMethods();
+ return specializeMembers(methods);
}
public IName getScopeName() {
@@ -199,22 +195,22 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat
return null;
}
- public ICPPConstructor[] getConstructors() throws DOMException {
+ public ICPPConstructor[] getConstructors() {
ICPPConstructor[] ctors= specialClass.getSpecializedBinding().getConstructors();
return specializeMembers(ctors);
}
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getDeclaredMethods() {
ICPPMethod[] bindings = specialClass.getSpecializedBinding().getDeclaredMethods();
return specializeMembers(bindings);
}
- public ICPPClassType[] getNestedClasses() throws DOMException {
+ public ICPPClassType[] getNestedClasses() {
ICPPClassType[] bindings = specialClass.getSpecializedBinding().getNestedClasses();
return specializeMembers(bindings);
}
- public IBinding[] getFriends() throws DOMException {
+ public IBinding[] getFriends() {
// not yet supported
return IBinding.EMPTY_BINDING_ARRAY;
}
@@ -230,7 +226,7 @@ public class AbstractCPPClassSpecializationScope implements ICPPClassSpecializat
return getOriginalClassType().getScope();
}
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
return CPPSemantics.findBindings(this, name, false);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTBaseSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTBaseSpecifier.java
index d794996e91..3e00dccd55 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTBaseSpecifier.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTBaseSpecifier.java
@@ -16,7 +16,6 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.ICPPASTCompletionContext;
@@ -129,13 +128,10 @@ public class CPPASTBaseSpecifier extends ASTNode implements ICPPASTBaseSpecifier
for (IBinding binding : bindings) {
if (binding instanceof ICPPClassType) {
ICPPClassType base = (ICPPClassType) binding;
- try {
- int key = base.getKey();
- if (key == ICPPClassType.k_class &&
- (classType == null || !base.isSameType(classType))) {
- filtered.add(base);
- }
- } catch (DOMException e) {
+ int key = base.getKey();
+ if (key == ICPPClassType.k_class &&
+ (classType == null || !base.isSameType(classType))) {
+ filtered.add(base);
}
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTName.java
index d0946cbfad..759dc7c5ef 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTName.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTName.java
@@ -13,9 +13,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTCompletionContext;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTName;
@@ -106,27 +104,22 @@ public class CPPASTName extends CPPASTNameBase implements ICPPASTCompletionConte
if (bindings[i] instanceof ICPPNamespace) {
} else if (bindings[i] instanceof ICPPClassType) {
ICPPClassType type = (ICPPClassType) bindings[i];
- try {
- switch (type.getKey()) {
- case ICompositeType.k_struct:
- if (kind != ICompositeType.k_struct) {
- bindings[i] = null;
- }
- break;
- case ICompositeType.k_union:
- if (kind != ICompositeType.k_union) {
- bindings[i] = null;
- }
- break;
- case ICPPClassType.k_class:
- if (kind != ICPPASTElaboratedTypeSpecifier.k_class) {
- bindings[i] = null;
- }
- break;
+ switch (type.getKey()) {
+ case ICompositeType.k_struct:
+ if (kind != ICompositeType.k_struct) {
+ bindings[i] = null;
}
- } catch (DOMException e) {
- bindings[i] = null;
- CCorePlugin.log(e);
+ break;
+ case ICompositeType.k_union:
+ if (kind != ICompositeType.k_union) {
+ bindings[i] = null;
+ }
+ break;
+ case ICPPClassType.k_class:
+ if (kind != ICPPASTElaboratedTypeSpecifier.k_class) {
+ bindings[i] = null;
+ }
+ break;
}
} else {
bindings[i]= null;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTNamespaceDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTNamespaceDefinition.java
index 357b7774c2..a59343dc62 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTNamespaceDefinition.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTNamespaceDefinition.java
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
@@ -101,11 +100,7 @@ public class CPPASTNamespaceDefinition extends ASTNode implements
}
public IScope getScope() {
- try {
- return ((ICPPNamespace) fName.resolveBinding()).getNamespaceScope();
- } catch ( DOMException e ) {
- return e.getProblem();
- }
+ return ((ICPPNamespace) fName.resolveBinding()).getNamespaceScope();
}
@Override
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java
index 40bfbe657a..98ca1e8d65 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java
@@ -257,14 +257,11 @@ public class CPPASTQualifiedName extends CPPASTNameBase
List<IBinding> filtered = filterClassScopeBindings(classType, bindings, isDeclaration);
if (isDeclaration && nameMatches(classType.getNameCharArray(),
n.getLookupKey(), isPrefix)) {
- try {
- ICPPConstructor[] constructors = classType.getConstructors();
- for (int i = 0; i < constructors.length; i++) {
- if (!constructors[i].isImplicit()) {
- filtered.add(constructors[i]);
- }
+ ICPPConstructor[] constructors = classType.getConstructors();
+ for (int i = 0; i < constructors.length; i++) {
+ if (!constructors[i].isImplicit()) {
+ filtered.add(constructors[i]);
}
- } catch (DOMException e) {
}
}
return filtered.toArray(new IBinding[filtered.size()]);
@@ -302,32 +299,29 @@ public class CPPASTQualifiedName extends CPPASTNameBase
List<IBinding> filtered = new ArrayList<IBinding>();
final boolean canBeFieldAccess= canBeFieldAccess(classType);
- try {
- for (final IBinding binding : bindings) {
- if (binding instanceof IField) {
- IField field = (IField) binding;
- if (!canBeFieldAccess && !field.isStatic())
+ for (final IBinding binding : bindings) {
+ if (binding instanceof IField) {
+ IField field = (IField) binding;
+ if (!canBeFieldAccess && !field.isStatic())
+ continue;
+ } else if (binding instanceof ICPPMethod) {
+ ICPPMethod method = (ICPPMethod) binding;
+ if (method.isImplicit())
+ continue;
+ if (!isDeclaration) {
+ if (method.isDestructor() || method instanceof ICPPConstructor
+ || (!canBeFieldAccess && !method.isStatic()))
continue;
- } else if (binding instanceof ICPPMethod) {
- ICPPMethod method = (ICPPMethod) binding;
- if (method.isImplicit())
- continue;
- if (!isDeclaration) {
- if (method.isDestructor() || method instanceof ICPPConstructor
- || (!canBeFieldAccess && !method.isStatic()))
- continue;
- }
- } else if (binding instanceof IEnumerator || binding instanceof IEnumeration) {
- if (isDeclaration)
- continue;
- } else if (binding instanceof IType) {
- IType type = (IType) binding;
- if (type.isSameType(classType))
- continue;
- }
- filtered.add(binding);
- }
- } catch (DOMException e) {
+ }
+ } else if (binding instanceof IEnumerator || binding instanceof IEnumeration) {
+ if (isDeclaration)
+ continue;
+ } else if (binding instanceof IType) {
+ IType type = (IType) binding;
+ if (type.isSameType(classType))
+ continue;
+ }
+ filtered.add(binding);
}
return filtered;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBaseClause.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBaseClause.java
index 0f8d8a3fb2..c377ea0a89 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBaseClause.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBaseClause.java
@@ -6,64 +6,23 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * Andrew Niefer (IBM Corporation) - initial API and implementation
* Bryan Wilkinson (QNX)
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.IName;
-import org.eclipse.cdt.core.dom.ast.DOMException;
-import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
-import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
-import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
-/**
- * @author aniefer
- */
public class CPPBaseClause implements ICPPBase, ICPPInternalBase {
- static public class CPPBaseProblem extends ProblemBinding implements ICPPBase, ICPPInternalBase {
- private ICPPClassType classProblem;
-
- public CPPBaseProblem(IASTNode node, int id, char[] arg) {
- super(node, id, arg);
- }
-
- public IBinding getBaseClass() {
- if (classProblem == null) {
- classProblem = new CPPClassType.CPPClassTypeProblem(node, id, arg);
- }
- return classProblem;
- }
-
- public int getVisibility() throws DOMException {
- throw new DOMException(this);
- }
-
- public boolean isVirtual() throws DOMException {
- throw new DOMException(this);
- }
-
- public IName getBaseClassSpecifierName() {
- return (IName) node;
- }
-
- public void setBaseClass(IBinding binding) {
- }
-
- @Override
- public ICPPBase clone() {
- return this;
- }
- }
-
private ICPPASTBaseSpecifier base;
private IBinding baseClass;
@@ -74,7 +33,7 @@ public class CPPBaseClause implements ICPPBase, ICPPInternalBase {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPBase#getBaseClass()
*/
- public IBinding getBaseClass() throws DOMException {
+ public IBinding getBaseClass() {
if (baseClass == null) {
IBinding b = base.getName().resolveBinding();
while (b instanceof ITypedef && ((ITypedef) b).getType() instanceof IBinding) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBlockScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBlockScope.java
index eaf23ab4af..19d1267752 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBlockScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBlockScope.java
@@ -1,18 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
*******************************************************************************/
-
-/*
- * Created on Nov 29, 2004
- */
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.IName;
@@ -22,11 +18,8 @@ import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBlockScope;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
+import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
-/**
- * @author aniefer
- */
public class CPPBlockScope extends CPPNamespaceScope implements ICPPBlockScope {
public CPPBlockScope( IASTNode physicalNode ){
super( physicalNode );
@@ -44,7 +37,7 @@ public class CPPBlockScope extends CPPNamespaceScope implements ICPPBlockScope {
final IASTNode parent= node.getParent();
if (parent instanceof IASTFunctionDefinition) {
IASTDeclarator dtor= ((IASTFunctionDefinition)parent).getDeclarator();
- dtor = CPPVisitor.findInnermostDeclarator(dtor);
+ dtor = ASTQueries.findInnermostDeclarator(dtor);
return dtor.getName();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBuiltinVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBuiltinVariable.java
index 6de75c9030..4dce03738c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBuiltinVariable.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPBuiltinVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems Inc. and others.
+ * Copyright (c) 2008, 2010 Wind River Systems Inc. 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
@@ -112,7 +111,7 @@ public class CPPBuiltinVariable extends CPPVariable {
}
@Override
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return null;
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassInstance.java
index 9c4549166d..b0280a25dc 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassInstance.java
@@ -15,7 +15,6 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.IType;
@@ -47,11 +46,7 @@ public class CPPClassInstance extends CPPClassSpecialization implements ICPPTemp
}
public boolean isExplicitSpecialization() {
- try {
- return !(getCompositeScope() instanceof ICPPClassSpecializationScope);
- } catch (DOMException e) {
- return false;
- }
+ return !(getCompositeScope() instanceof ICPPClassSpecializationScope);
}
@Deprecated
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
index 0e8f0e6a36..1a2c49365c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassScope.java
@@ -31,11 +31,11 @@ import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
+import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType;
-import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamedTypeSpecifier;
@@ -161,7 +161,7 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
}
@Override
- public void addName(IASTName name) throws DOMException {
+ public void addName(IASTName name) {
// don't add names from inactive code branches
if (!name.isActive())
return;
@@ -213,7 +213,7 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPScope#getBinding(int, char[])
*/
@Override
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
char[] c = name.getLookupKey();
ICPPASTCompositeTypeSpecifier compType = (ICPPASTCompositeTypeSpecifier) getPhysicalNode();
@@ -230,7 +230,7 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
@Override
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet,
- boolean checkPointOfDecl) throws DOMException {
+ boolean checkPointOfDecl) {
char[] c = name.getLookupKey();
ICPPASTCompositeTypeSpecifier compType = (ICPPASTCompositeTypeSpecifier) getPhysicalNode();
@@ -314,7 +314,7 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
* @see org.eclipse.cdt.core.dom.ast.IScope#find(java.lang.String)
*/
@Override
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
char[] n = name.toCharArray();
ICPPASTCompositeTypeSpecifier compType = (ICPPASTCompositeTypeSpecifier) getPhysicalNode();
IASTName compName = compType.getName().getLastName();
@@ -374,7 +374,8 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
*/
public ICPPMethod[] getImplicitMethods() {
if (implicits == null)
- implicits = new ICPPMethod[] { new CPPMethod.CPPMethodProblem(null, IProblemBinding.SEMANTIC_INVALID_TYPE, CharArrayUtils.EMPTY) };
+ return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
+
return implicits;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
index 1b59e3ffe8..27b210b55d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -12,7 +12,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
+import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@@ -25,7 +25,6 @@ import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
-import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateDeclaration;
@@ -84,7 +83,7 @@ public class CPPClassSpecialization extends CPPSpecialization
}
}
- private class FindDefinitionAction extends CPPASTVisitor {
+ private class FindDefinitionAction extends ASTVisitor {
private char [] nameArray = CPPClassSpecialization.this.getNameCharArray();
public IASTName result = null;
@@ -177,7 +176,7 @@ public class CPPClassSpecialization extends CPPSpecialization
return null;
}
- public ICPPBase[] getBases() throws DOMException {
+ public ICPPBase[] getBases() {
ICPPClassSpecializationScope scope= getSpecializationScope();
if (scope == null)
return ClassTypeHelper.getBases(this);
@@ -185,7 +184,7 @@ public class CPPClassSpecialization extends CPPSpecialization
return scope.getBases();
}
- public ICPPField[] getDeclaredFields() throws DOMException {
+ public ICPPField[] getDeclaredFields() {
ICPPClassSpecializationScope scope= getSpecializationScope();
if (scope == null)
return ClassTypeHelper.getDeclaredFields(this);
@@ -193,7 +192,7 @@ public class CPPClassSpecialization extends CPPSpecialization
return scope.getDeclaredFields();
}
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getDeclaredMethods() {
ICPPClassSpecializationScope scope= getSpecializationScope();
if (scope == null)
return ClassTypeHelper.getDeclaredMethods(this);
@@ -201,7 +200,7 @@ public class CPPClassSpecialization extends CPPSpecialization
return scope.getDeclaredMethods();
}
- public ICPPConstructor[] getConstructors() throws DOMException {
+ public ICPPConstructor[] getConstructors() {
ICPPClassSpecializationScope scope= getSpecializationScope();
if (scope == null)
return ClassTypeHelper.getConstructors(this);
@@ -209,7 +208,7 @@ public class CPPClassSpecialization extends CPPSpecialization
return scope.getConstructors();
}
- public IBinding[] getFriends() throws DOMException {
+ public IBinding[] getFriends() {
ICPPClassSpecializationScope scope= getSpecializationScope();
if (scope == null)
return ClassTypeHelper.getFriends(this);
@@ -217,7 +216,7 @@ public class CPPClassSpecialization extends CPPSpecialization
return scope.getFriends();
}
- public ICPPClassType[] getNestedClasses() throws DOMException {
+ public ICPPClassType[] getNestedClasses() {
ICPPClassSpecializationScope scope= getSpecializationScope();
if (scope == null)
return ClassTypeHelper.getNestedClasses(this);
@@ -226,19 +225,19 @@ public class CPPClassSpecialization extends CPPSpecialization
}
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
return ClassTypeHelper.getFields(this);
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
return ClassTypeHelper.findField(this, name);
}
- public ICPPMethod[] getMethods() throws DOMException {
+ public ICPPMethod[] getMethods() {
return ClassTypeHelper.getMethods(this);
}
- public ICPPMethod[] getAllDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getAllDeclaredMethods() {
return ClassTypeHelper.getAllDeclaredMethods(this);
}
@@ -246,7 +245,7 @@ public class CPPClassSpecialization extends CPPSpecialization
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.ICompositeType#getKey()
*/
- public int getKey() throws DOMException {
+ public int getKey() {
if (getDefinition() != null)
return getCompositeTypeSpecifier().getKey();
@@ -256,7 +255,7 @@ public class CPPClassSpecialization extends CPPSpecialization
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.ICompositeType#getCompositeScope()
*/
- public ICPPClassScope getCompositeScope() throws DOMException {
+ public ICPPClassScope getCompositeScope() {
final ICPPClassScope specScope= getSpecializationScope();
if (specScope != null)
return specScope;
@@ -297,7 +296,7 @@ public class CPPClassSpecialization extends CPPSpecialization
return this;
}
- public boolean isAnonymous() throws DOMException {
+ public boolean isAnonymous() {
if (getNameCharArray().length > 0)
return false;
@@ -322,26 +321,22 @@ public class CPPClassSpecialization extends CPPSpecialization
t2 instanceof IProblemBinding)
return false;
- try {
- if (t1.getKey() != t2.getKey())
- return false;
-
- if (!CharArrayUtils.equals(t1.getNameCharArray(), t2.getNameCharArray()))
- return false;
-
- // the argument map is not significant for comparing specializations, the map is
- // determined by the owner of the specialization. This is different for instances,
- // which have a separate implementation for isSameType().
- final IBinding owner1= t1.getOwner();
- final IBinding owner2= t2.getOwner();
-
- // for a specialization that is not an instance the owner has to be a class-type
- if (owner1 instanceof ICPPClassType == false || owner2 instanceof ICPPClassType == false)
- return false;
-
- return ((ICPPClassType) owner1).isSameType((ICPPClassType) owner2);
- } catch (DOMException e) {
+ if (t1.getKey() != t2.getKey())
return false;
- }
+
+ if (!CharArrayUtils.equals(t1.getNameCharArray(), t2.getNameCharArray()))
+ return false;
+
+ // the argument map is not significant for comparing specializations, the map is
+ // determined by the owner of the specialization. This is different for instances,
+ // which have a separate implementation for isSameType().
+ final IBinding owner1= t1.getOwner();
+ final IBinding owner2= t2.getOwner();
+
+ // for a specialization that is not an instance the owner has to be a class-type
+ if (owner1 instanceof ICPPClassType == false || owner2 instanceof ICPPClassType == false)
+ return false;
+
+ return ((ICPPClassType) owner1).isSameType((ICPPClassType) owner2);
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java
index 7d6f66f236..fec1948046 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassTemplate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -14,6 +14,7 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
+import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
@@ -27,7 +28,6 @@ import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
-import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
@@ -60,7 +60,7 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements ICPPClass
private boolean checkedIndex= false;
private boolean checkedDefinition= false;
- private class FindDefinitionAction extends CPPASTVisitor {
+ private class FindDefinitionAction extends ASTVisitor {
private char[] nameArray = CPPClassTemplate.this.getNameCharArray();
public IASTName result = null;
@@ -170,13 +170,9 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements ICPPClass
// Forward declarations must be backed up from the index.
checkForIndexBinding();
if (fIndexBinding != null) {
- try {
- IScope scope = fIndexBinding.getCompositeScope();
- if (scope instanceof ICPPClassScope)
- return (ICPPClassScope) scope;
- } catch (DOMException e) {
- // index bindings don't throw DOMExeptions.
- }
+ IScope scope = fIndexBinding.getCompositeScope();
+ if (scope instanceof ICPPClassScope)
+ return (ICPPClassScope) scope;
}
return null;
}
@@ -220,27 +216,27 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements ICPPClass
return ClassTypeHelper.getBases(this);
}
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
return ClassTypeHelper.getFields(this);
}
- public ICPPField[] getDeclaredFields() throws DOMException {
+ public ICPPField[] getDeclaredFields() {
return ClassTypeHelper.getDeclaredFields(this);
}
- public ICPPMethod[] getMethods() throws DOMException {
+ public ICPPMethod[] getMethods() {
return ClassTypeHelper.getMethods(this);
}
- public ICPPMethod[] getAllDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getAllDeclaredMethods() {
return ClassTypeHelper.getAllDeclaredMethods(this);
}
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getDeclaredMethods() {
return ClassTypeHelper.getDeclaredMethods(this);
}
- public ICPPConstructor[] getConstructors() throws DOMException {
+ public ICPPConstructor[] getConstructors() {
return ClassTypeHelper.getConstructors(this);
}
@@ -252,7 +248,7 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements ICPPClass
return ClassTypeHelper.getNestedClasses(this);
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
return ClassTypeHelper.findField(this, name);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java
index 82fd727fb7..33f3fd3c6d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPClassType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -15,6 +15,7 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage;
+import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
@@ -29,7 +30,6 @@ import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
-import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
@@ -65,60 +65,48 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
public CPPClassTypeProblem(IASTNode node, int id, char[] arg) {
super(node, id, arg);
}
- public ICPPBase[] getBases() throws DOMException {
- throw new DOMException(this);
+ public ICPPBase[] getBases() {
+ return ICPPBase.EMPTY_BASE_ARRAY;
}
- public IField[] getFields() throws DOMException {
- throw new DOMException(this);
+ public IField[] getFields() {
+ return IField.EMPTY_FIELD_ARRAY;
}
- public ICPPField[] getDeclaredFields() throws DOMException {
- throw new DOMException(this);
+ public ICPPField[] getDeclaredFields() {
+ return ICPPField.EMPTY_CPPFIELD_ARRAY;
}
- public ICPPMethod[] getMethods() throws DOMException {
- throw new DOMException(this);
+ public ICPPMethod[] getMethods() {
+ return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
}
- public ICPPMethod[] getAllDeclaredMethods() throws DOMException {
- throw new DOMException(this);
+ public ICPPMethod[] getAllDeclaredMethods() {
+ return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
}
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
- throw new DOMException(this);
+ public ICPPMethod[] getDeclaredMethods() {
+ return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
}
- public ICPPConstructor[] getConstructors() throws DOMException {
- throw new DOMException(this);
+ public ICPPConstructor[] getConstructors() {
+ return ICPPConstructor.EMPTY_CONSTRUCTOR_ARRAY;
}
public ICPPMethod[] getDeclaredConversionOperators() throws DOMException {
throw new DOMException(this);
}
- public int getKey() throws DOMException {
- throw new DOMException(this);
+ public int getKey() {
+ return k_class;
}
- public IField findField(String name) throws DOMException {
- throw new DOMException(this);
+ public IField findField(String name) {
+ return null;
}
- public IScope getCompositeScope() throws DOMException {
- throw new DOMException(this);
+ public IScope getCompositeScope() {
+ return this;
}
- public IBinding[] getFriends() throws DOMException {
- throw new DOMException(this);
+ public IBinding[] getFriends() {
+ return IBinding.EMPTY_BINDING_ARRAY;
}
- 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 ICPPClassType[] getNestedClasses() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isAnonymous() throws DOMException {
- throw new DOMException(this);
+ public ICPPClassType[] getNestedClasses() {
+ return ICPPClassType.EMPTY_CLASS_ARRAY;
}
}
- private class FindDefinitionAction extends CPPASTVisitor {
+ private class FindDefinitionAction extends ASTVisitor {
private char[] nameArray = CPPClassType.this.getNameCharArray();
public IASTName result = null;
@@ -287,13 +275,9 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
}
// fwd-declarations must be backed up from the index
if (typeInIndex != null) {
- try {
- IScope scope = typeInIndex.getCompositeScope();
- if (scope instanceof ICPPClassScope)
- return (ICPPClassScope) scope;
- } catch (DOMException e) {
- // index bindings don't throw DOMExeptions.
- }
+ IScope scope = typeInIndex.getCompositeScope();
+ if (scope instanceof ICPPClassScope)
+ return (ICPPClassScope) scope;
}
return null;
}
@@ -367,27 +351,27 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
return ClassTypeHelper.getBases(this);
}
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
return ClassTypeHelper.getFields(this);
}
- public ICPPField[] getDeclaredFields() throws DOMException {
+ public ICPPField[] getDeclaredFields() {
return ClassTypeHelper.getDeclaredFields(this);
}
- public ICPPMethod[] getMethods() throws DOMException {
+ public ICPPMethod[] getMethods() {
return ClassTypeHelper.getMethods(this);
}
- public ICPPMethod[] getAllDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getAllDeclaredMethods() {
return ClassTypeHelper.getAllDeclaredMethods(this);
}
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getDeclaredMethods() {
return ClassTypeHelper.getDeclaredMethods(this);
}
- public ICPPConstructor[] getConstructors() throws DOMException {
+ public ICPPConstructor[] getConstructors() {
return ClassTypeHelper.getConstructors(this);
}
@@ -399,7 +383,7 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
return ClassTypeHelper.getNestedClasses(this);
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
return ClassTypeHelper.findField(this, name);
}
@@ -420,14 +404,14 @@ public class CPPClassType extends PlatformObject implements ICPPInternalClassTyp
return getName();
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
if (definition != null) {
return CPPVisitor.findNameOwner(definition, true);
}
return CPPVisitor.findDeclarationOwner(declarations[0], true);
}
- public boolean isAnonymous() throws DOMException {
+ public boolean isAnonymous() {
if (getNameCharArray().length > 0)
return false;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPCompositeBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPCompositeBinding.java
index 6d69f2f355..c0b20a6eca 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPCompositeBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPCompositeBinding.java
@@ -1,17 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * Andrew Niefer (IBM Corporation) - initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
-/*
- * Created on Dec 16, 2004
- */
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage;
@@ -23,9 +20,6 @@ import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.core.runtime.PlatformObject;
-/**
- * @author aniefer
- */
public class CPPCompositeBinding extends PlatformObject implements IBinding {
IBinding [] bindings = null;
@@ -55,7 +49,7 @@ public class CPPCompositeBinding extends PlatformObject implements IBinding {
return bindings[0].getScope();
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return bindings[0].getOwner();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructor.java
index 90eea907cd..95e3fe4416 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructor.java
@@ -1,38 +1,32 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * Andrew Niefer (IBM Corporation) - initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
-/*
- * Created on Dec 21, 2004
- */
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
-/**
- * @author aniefer
- */
public class CPPConstructor extends CPPMethod implements ICPPConstructor {
static public class CPPConstructorProblem extends CPPMethod.CPPMethodProblem implements ICPPConstructor {
- public CPPConstructorProblem(IASTNode node, int id, char[] arg) {
- super(node, id, arg);
+ public CPPConstructorProblem(ICPPClassType owner, IASTNode node, int id, char[] arg) {
+ super(owner, node, id, arg);
}
- public boolean isExplicit() throws DOMException{
- throw new DOMException( this );
+ public boolean isExplicit() {
+ return false;
}
}
@@ -46,7 +40,7 @@ public class CPPConstructor extends CPPMethod implements ICPPConstructor {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor#isExplicit()
*/
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
IASTDeclaration decl= getPrimaryDeclaration();
if (decl != null) {
ICPPASTDeclSpecifier declspec= getDeclSpec(decl);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorInstance.java
index 7b0d767586..a62d8ff66d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorInstance.java
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument;
@@ -26,7 +25,7 @@ public class CPPConstructorInstance extends CPPMethodInstance implements ICPPCon
super(orig, owner, tpmap, args);
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return ((ICPPConstructor) getTemplateDefinition()).isExplicit();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorSpecialization.java
index 7b44b13adf..9f067d5217 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorSpecialization.java
@@ -1,5 +1,5 @@
/*************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameterMap;
@@ -30,7 +29,7 @@ public class CPPConstructorSpecialization extends CPPMethodSpecialization
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor#isExplicit()
*/
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return ((ICPPConstructor)getSpecializedBinding()).isExplicit();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorTemplate.java
index 30b1801713..6c8add94b5 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorTemplate.java
@@ -1,39 +1,29 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM - Initial API and implementation
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
*******************************************************************************/
-/*
- * Created on Mar 31, 2005
- */
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
-/**
- * @author aniefer
- */
-public class CPPConstructorTemplate extends CPPMethodTemplate implements
- ICPPConstructor {
+public class CPPConstructorTemplate extends CPPMethodTemplate implements ICPPConstructor {
- /**
- * @param name
- */
public CPPConstructorTemplate(IASTName name) {
super(name);
- // TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor#isExplicit()
*/
public boolean isExplicit() {
+ // mstodo fix that
// TODO Auto-generated method stub
return false;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorTemplateSpecialization.java
index d643f89abf..1dd2474514 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorTemplateSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPConstructorTemplateSpecialization.java
@@ -1,5 +1,5 @@
/*************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameterMap;
@@ -30,7 +29,7 @@ public class CPPConstructorTemplateSpecialization extends CPPMethodTemplateSpeci
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor#isExplicit()
*/
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return ((ICPPConstructor)getSpecializedBinding()).isExplicit();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredClassInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredClassInstance.java
index 7a420c8065..afb12fc617 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredClassInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPDeferredClassInstance.java
@@ -51,11 +51,7 @@ public class CPPDeferredClassInstance extends CPPUnknownClass implements ICPPDef
@Override
public IBinding getOwner() {
- try {
- return fClassTemplate.getOwner();
- } catch (DOMException e) {
- return e.getProblem();
- }
+ return fClassTemplate.getOwner();
}
public ICPPClassTemplate getClassTemplate() {
@@ -93,7 +89,7 @@ public class CPPDeferredClassInstance extends CPPUnknownClass implements ICPPDef
}
@Override
- public int getKey() throws DOMException {
+ public int getKey() {
return getClassTemplate().getKey();
}
@@ -138,7 +134,7 @@ public class CPPDeferredClassInstance extends CPPUnknownClass implements ICPPDef
}
@Override
- public ICPPScope asScope() throws DOMException {
+ public ICPPScope asScope() {
if (fLookupScope != null)
return fLookupScope;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumeration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumeration.java
index 123b68ff3c..773ef53d25 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumeration.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumeration.java
@@ -13,6 +13,7 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage;
+import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
@@ -29,7 +30,6 @@ import org.eclipse.cdt.core.dom.ast.IScope;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.IValue;
-import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTEnumerationSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
@@ -78,7 +78,7 @@ public class CPPEnumeration extends PlatformObject implements ICPPEnumeration, I
return fDeclarations;
}
- private class FindDefinitionAction extends CPPASTVisitor {
+ private class FindDefinitionAction extends ASTVisitor {
private char[] nameArray = CPPEnumeration.this.getNameCharArray();
public IASTName result = null;
@@ -197,7 +197,7 @@ public class CPPEnumeration extends PlatformObject implements ICPPEnumeration, I
return Linkage.CPP_LINKAGE;
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return CPPVisitor.findDeclarationOwner(getADeclaration(), true);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumerator.java
index 471a68f8f5..1a89f15b76 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumerator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPEnumerator.java
@@ -131,7 +131,7 @@ public class CPPEnumerator extends PlatformObject implements IEnumerator, ICPPIn
return Linkage.CPP_LINKAGE;
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return CPPVisitor.findDeclarationOwner(enumName, true);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPField.java
index 1f20d09302..7df5ae6527 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPField.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPField.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -11,8 +11,8 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
+import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTName;
@@ -20,7 +20,6 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
-import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
@@ -34,26 +33,19 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
*/
public class CPPField extends CPPVariable implements ICPPField {
public static class CPPFieldProblem extends CPPVariable.CPPVariableProblem implements ICPPField {
- /**
- * @param id
- * @param arg
- */
- public CPPFieldProblem( IASTNode node, int id, char[] arg ) {
- super( node, id, arg );
- }
+ private ICPPClassType fOwner;
- public int getVisibility() throws DOMException {
- throw new DOMException( this );
+ public CPPFieldProblem(ICPPClassType owner, IASTNode node, int id, char[] arg ) {
+ super( node, id, arg );
+ fOwner= owner;
}
- public ICPPClassType getClassOwner() throws DOMException {
- throw new DOMException( this );
+ public int getVisibility() {
+ return v_private;
}
- @Override
- public boolean isStatic() throws DOMException {
- throw new DOMException( this );
+ public ICPPClassType getClassOwner() {
+ return fOwner;
}
-
- public ICompositeType getCompositeTypeOwner() throws DOMException {
+ public ICompositeType getCompositeTypeOwner() {
return getClassOwner();
}
}
@@ -62,7 +54,7 @@ public class CPPField extends CPPVariable implements ICPPField {
super( name );
}
- public IASTDeclaration getPrimaryDeclaration() throws DOMException{
+ public IASTDeclaration getPrimaryDeclaration() {
//first check if we already know it
IASTDeclaration decl= findDeclaration(getDefinition());
if (decl != null) {
@@ -108,7 +100,7 @@ public class CPPField extends CPPVariable implements ICPPField {
return null;
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
ICPPASTVisibilityLabel vis = null;
IASTDeclaration decl = getPrimaryDeclaration();
if( decl != null ) {
@@ -131,7 +123,7 @@ public class CPPField extends CPPVariable implements ICPPField {
return ICPPASTVisibilityLabel.v_public;
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
ICPPClassScope scope = (ICPPClassScope) getScope();
return scope.getClassType();
}
@@ -151,7 +143,7 @@ public class CPPField extends CPPVariable implements ICPPField {
@Override
public boolean isMutable() {
- return hasStorageClass( ICPPASTDeclSpecifier.sc_mutable);
+ return hasStorageClass( IASTDeclSpecifier.sc_mutable);
}
@Override
@@ -160,7 +152,7 @@ public class CPPField extends CPPVariable implements ICPPField {
return false;
}
- public ICompositeType getCompositeTypeOwner() throws DOMException {
+ public ICompositeType getCompositeTypeOwner() {
return getClassOwner();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java
index 5afae0f97d..1d2614dd1f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFieldSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -37,11 +37,11 @@ public class CPPFieldSpecialization extends CPPSpecialization implements ICPPFie
return (ICPPField) getSpecializedBinding();
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return getField().getVisibility();
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
return getField().getClassOwner();
}
@@ -52,23 +52,23 @@ public class CPPFieldSpecialization extends CPPSpecialization implements ICPPFie
return type;
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return getField().isStatic();
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return getField().isExtern();
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return getField().isAuto();
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return getField().isRegister();
}
- public boolean isMutable() throws DOMException {
+ public boolean isMutable() {
return getField().isMutable();
}
@@ -76,7 +76,7 @@ public class CPPFieldSpecialization extends CPPSpecialization implements ICPPFie
return false;
}
- public ICompositeType getCompositeTypeOwner() throws DOMException {
+ public ICompositeType getCompositeTypeOwner() {
return getClassOwner();
}
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 b79811985d..7070db7248 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();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java
index 5c53881f64..2c74766f7a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -77,7 +77,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
* @see org.eclipse.cdt.core.dom.ast.IScope#find(java.lang.String)
*/
@Override
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
char[] n = name.toCharArray();
List<IBinding> bindings = new ArrayList<IBinding>();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java
index 06efc960fd..c2b6d19424 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionSpecialization.java
@@ -113,7 +113,7 @@ public class CPPFunctionSpecialization extends CPPSpecialization implements ICPP
return false;
}
- public boolean isInline() throws DOMException {
+ public boolean isInline() {
if (getDefinition() != null) {
IASTNode def = getDefinition();
while (!(def instanceof IASTFunctionDefinition))
@@ -123,7 +123,7 @@ public class CPPFunctionSpecialization extends CPPSpecialization implements ICPP
return getFunction().isInline();
}
- public boolean isExternC() throws DOMException {
+ public boolean isExternC() {
if (CPPVisitor.isExternC(getDefinition())) {
return true;
}
@@ -139,35 +139,33 @@ public class CPPFunctionSpecialization extends CPPSpecialization implements ICPP
if (f instanceof ICPPInternalFunction)
return ((ICPPInternalFunction)f).isStatic(resolveAll);
if (f instanceof IIndexBinding && f instanceof ICPPFunction) {
- try {
- return ((ICPPFunction) f).isStatic();
- } catch(DOMException de) { /* cannot occur as we query the index */}
+ return ((ICPPFunction) f).isStatic();
}
return CPPFunction.hasStorageClass(this, IASTDeclSpecifier.sc_static);
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
ICPPFunction f = (ICPPFunction) getSpecializedBinding();
if (f != null)
return f.isExtern();
return CPPFunction.hasStorageClass(this, IASTDeclSpecifier.sc_extern);
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
ICPPFunction f = (ICPPFunction) getSpecializedBinding();
if (f != null)
return f.isAuto();
return CPPFunction.hasStorageClass(this, IASTDeclSpecifier.sc_auto);
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
ICPPFunction f = (ICPPFunction) getSpecializedBinding();
if (f != null)
return f.isRegister();
return CPPFunction.hasStorageClass(this, IASTDeclSpecifier.sc_register);
}
- public boolean takesVarArgs() throws DOMException {
+ public boolean takesVarArgs() {
ICPPFunction f = (ICPPFunction) getSpecializedBinding();
if (f != null)
return f.takesVarArgs();
@@ -295,7 +293,7 @@ public class CPPFunctionSpecialization extends CPPSpecialization implements ICPP
return result.toString();
}
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
if (specializedExceptionSpec == null) {
ICPPFunction function = (ICPPFunction) getSpecializedBinding();
IType[] types = function.getExceptionSpecification();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java
index 9e0e31ac8c..eb06acaede 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPFunctionTemplate.java
@@ -57,60 +57,19 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition
public ICPPClassTemplatePartialSpecialization[] getTemplateSpecializations() 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 ICPPParameter[] getParameters() throws DOMException {
throw new DOMException(this);
}
public IScope getFunctionScope() throws DOMException {
throw new DOMException(this);
}
+ @Override
public ICPPFunctionType getType() throws DOMException {
throw new DOMException(this);
}
- public boolean isStatic() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isExtern() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isAuto() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isRegister() throws DOMException {
- throw new DOMException(this);
- }
- public boolean takesVarArgs() 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;
- }
}
protected ICPPFunctionType type = null;
@@ -316,7 +275,7 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition
return hasStorageClass(IASTDeclSpecifier.sc_mutable);
}
- public boolean isInline() throws DOMException {
+ public boolean isInline() {
IASTName name = (IASTName) getDefinition();
IASTNode[] ns = getDeclarations();
int i = -1;
@@ -344,7 +303,7 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition
return false;
}
- public boolean isExternC() throws DOMException {
+ public boolean isExternC() {
if (CPPVisitor.isExternC(getDefinition())) {
return true;
}
@@ -407,7 +366,7 @@ public class CPPFunctionTemplate extends CPPTemplateDefinition
return result.toString();
}
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
ICPPASTFunctionDeclarator declarator = getFirstFunctionDtor();
if (declarator != null) {
IASTTypeId[] astTypeIds = declarator.getExceptionSpecification();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitMethod.java
index 6635e53cd6..ad90140553 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitMethod.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPImplicitMethod.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@@ -46,7 +45,7 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
super(name, scope, type, params, false);
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
IASTDeclaration decl= getPrimaryDeclaration();
if (decl == null) {
// 12.1-5, 12.8-10 Implicit constructors and assignment operators are public
@@ -82,7 +81,7 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
return scope.getClassType();
}
- public IASTDeclaration getPrimaryDeclaration() throws DOMException {
+ public IASTDeclaration getPrimaryDeclaration() {
// first check if we already know it
if (declarations != null) {
for (IASTDeclarator dtor : declarations) {
@@ -170,11 +169,7 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
}
public boolean isImplicit() {
- try {
- return getPrimaryDeclaration() == null;
- } catch (DOMException e) {
- }
- return true;
+ return getPrimaryDeclaration() == null;
}
public boolean isPureVirtual() {
@@ -187,7 +182,7 @@ public class CPPImplicitMethod extends CPPImplicitFunction implements ICPPMethod
}
@Override
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
return ClassTypeHelper.getInheritedExceptionSpecification(this);
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPLabel.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPLabel.java
index 7f37a03015..e4e0f57baf 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPLabel.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPLabel.java
@@ -1,18 +1,17 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTLabelStatement;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
@@ -23,9 +22,6 @@ import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.core.runtime.PlatformObject;
-/**
- * @author aniefer
- */
public class CPPLabel extends PlatformObject implements ILabel, ICPPInternalBinding {
private IASTName statement;
@@ -93,7 +89,7 @@ public class CPPLabel extends PlatformObject implements ILabel, ICPPInternalBind
return Linkage.CPP_LINKAGE;
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return CPPVisitor.findEnclosingFunction(statement);
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java
index 18fefacb7f..e9a5d0423b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethod.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
@@ -29,6 +28,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisibilityLabel;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPMember;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
@@ -40,21 +40,13 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
*/
public class CPPMethod extends CPPFunction implements ICPPMethod {
public static class CPPMethodProblem extends CPPFunctionProblem implements ICPPMethod {
- public CPPMethodProblem(IASTNode node, int id, char[] arg) {
+ private ICPPClassType fOwner;
+ public CPPMethodProblem(ICPPClassType owner, IASTNode node, int id, char[] arg) {
super(node, id, arg);
+ fOwner= owner;
}
-
- public int getVisibility() throws DOMException {
- throw new DOMException(this);
- }
- public ICPPClassType getClassOwner() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isVirtual() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isPureVirtual() throws DOMException {
- throw new DOMException(this);
+ public ICPPClassType getClassOwner() {
+ return fOwner;
}
public boolean isDestructor() {
char[] name = getNameCharArray();
@@ -63,8 +55,8 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
return false;
}
- public boolean isImplicit() {
- return false;
+ public int getVisibility() {
+ return ICPPMember.v_private;
}
}
@@ -72,7 +64,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
super(declarator);
}
- public IASTDeclaration getPrimaryDeclaration() throws DOMException{
+ public IASTDeclaration getPrimaryDeclaration() {
//first check if we already know it
if (declarations != null) {
for (IASTDeclarator dtor : declarations) {
@@ -120,7 +112,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMember#getVisibility()
*/
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
IASTDeclaration decl = getPrimaryDeclaration();
if( decl == null ){
IScope scope = getScope();
@@ -149,7 +141,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
return ICPPASTVisibilityLabel.v_public;
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
ICPPClassScope scope = (ICPPClassScope)getScope();
return scope.getClassType();
}
@@ -174,7 +166,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isVirtual()
*/
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
IASTDeclaration decl = getPrimaryDeclaration();
if( decl != null ){
ICPPASTDeclSpecifier declSpec = getDeclSpec(decl);
@@ -198,7 +190,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction#isInline()
*/
@Override
- public boolean isInline() throws DOMException {
+ public boolean isInline() {
IASTDeclaration decl = getPrimaryDeclaration();
if( decl instanceof IASTFunctionDefinition )
return true;
@@ -214,7 +206,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
*/
@Override
public boolean isMutable() {
- return hasStorageClass( this, ICPPASTDeclSpecifier.sc_mutable );
+ return hasStorageClass( this, IASTDeclSpecifier.sc_mutable );
}
/* (non-Javadoc)
@@ -235,7 +227,7 @@ public class CPPMethod extends CPPFunction implements ICPPMethod {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isPureVirtual()
*/
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
if (declarations != null) {
for (IASTDeclarator dtor : declarations) {
if (dtor == null)
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodInstance.java
index a24beb7690..1c687d96f0 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodInstance.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument;
@@ -28,25 +27,25 @@ public class CPPMethodInstance extends CPPFunctionInstance implements ICPPMethod
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMember#getVisibility()
*/
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return ((ICPPMethod)getTemplateDefinition()).getVisibility();
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
return (ICPPClassType) getOwner();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isVirtual()
*/
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return ((ICPPMethod)getTemplateDefinition()).isVirtual();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod#isPureVirtual()
*/
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return ((ICPPMethod)getTemplateDefinition()).isPureVirtual();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodSpecialization.java
index d5531f13e8..a56ac19b63 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
import org.eclipse.cdt.core.dom.ast.IASTNode;
@@ -32,7 +31,7 @@ public class CPPMethodSpecialization extends CPPFunctionSpecialization
super(orig, owner, argMap );
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
ICPPMethod f = (ICPPMethod) getSpecializedBinding();
if( f != null )
return f.isVirtual();
@@ -55,14 +54,14 @@ public class CPPMethodSpecialization extends CPPFunctionSpecialization
return false;
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
ICPPMethod f = (ICPPMethod) getSpecializedBinding();
if( f != null )
return f.getVisibility();
return 0;
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
return (ICPPClassType) getOwner();
}
@@ -78,7 +77,7 @@ public class CPPMethodSpecialization extends CPPFunctionSpecialization
return ((ICPPMethod) getSpecializedBinding()).isImplicit();
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
ICPPMethod f = (ICPPMethod) getSpecializedBinding();
if (f != null)
return f.isPureVirtual();
@@ -87,7 +86,7 @@ public class CPPMethodSpecialization extends CPPFunctionSpecialization
}
@Override
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
if (isImplicit()) {
return ClassTypeHelper.getInheritedExceptionSpecification(this);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplate.java
index bccfd93b3f..bd2f6ff79e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -40,7 +40,7 @@ public class CPPMethodTemplate extends CPPFunctionTemplate implements ICPPMethod
super(name);
}
- public IASTDeclaration getPrimaryDeclaration() throws DOMException{
+ public IASTDeclaration getPrimaryDeclaration() {
//first check if we already know it
if (declarations != null) {
for (IASTName declaration : declarations) {
@@ -65,8 +65,13 @@ public class CPPMethodTemplate extends CPPFunctionTemplate implements ICPPMethod
final char[] myName = getTemplateName().getLookupKey();
IScope scope = getScope();
- if (scope instanceof ICPPTemplateScope)
- scope = scope.getParent();
+ if (scope instanceof ICPPTemplateScope) {
+ try {
+ scope = scope.getParent();
+ } catch (DOMException e) {
+ return null;
+ }
+ }
ICPPClassScope clsScope = (ICPPClassScope) scope;
ICPPASTCompositeTypeSpecifier compSpec = (ICPPASTCompositeTypeSpecifier) ASTInternal.getPhysicalNodeOfScope(clsScope);
IASTDeclaration[] members = compSpec.getMembers();
@@ -92,7 +97,7 @@ public class CPPMethodTemplate extends CPPFunctionTemplate implements ICPPMethod
return null;
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
IASTDeclaration decl = getPrimaryDeclaration();
if( decl == null ){
ICPPClassType cls = getClassOwner();
@@ -118,10 +123,14 @@ public class CPPMethodTemplate extends CPPFunctionTemplate implements ICPPMethod
return ICPPASTVisibilityLabel.v_public;
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
IScope scope= getScope();
if (scope instanceof ICPPTemplateScope) {
- scope= scope.getParent();
+ try {
+ scope= scope.getParent();
+ } catch (DOMException e) {
+ return null;
+ }
}
if( scope instanceof ICPPClassScope ){
return ((ICPPClassScope)scope).getClassType();
@@ -135,7 +144,7 @@ public class CPPMethodTemplate extends CPPFunctionTemplate implements ICPPMethod
}
@Override
- public boolean isInline() throws DOMException {
+ public boolean isInline() {
IASTDeclaration decl = getPrimaryDeclaration();
if( decl instanceof ICPPASTTemplateDeclaration && ((ICPPASTTemplateDeclaration)decl).getDeclaration() instanceof IASTFunctionDefinition )
return true;
@@ -155,7 +164,7 @@ public class CPPMethodTemplate extends CPPFunctionTemplate implements ICPPMethod
return false;
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return false;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplateSpecialization.java
index 14058959a5..5ec15ba6be 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplateSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPMethodTemplateSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
@@ -33,14 +32,14 @@ public class CPPMethodTemplateSpecialization extends CPPFunctionTemplateSpeciali
return false;
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
IBinding m = getSpecializedBinding();
if( m instanceof ICPPMethod )
return ((ICPPMethod)m).getVisibility();
return 0;
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
return (ICPPClassType) getOwner();
}
@@ -56,7 +55,7 @@ public class CPPMethodTemplateSpecialization extends CPPFunctionTemplateSpeciali
return false;
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return false;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java
index aea25ed1f5..9bf75fe1f2 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespace.java
@@ -6,13 +6,13 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
+import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@@ -23,7 +23,6 @@ import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
-import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLinkageSpecification;
@@ -32,6 +31,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDeclaration;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDirective;
import org.eclipse.cdt.core.parser.Keywords;
import org.eclipse.cdt.core.parser.util.ArrayUtil;
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
@@ -43,31 +43,24 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.cdt.internal.core.model.ASTStringUtil;
import org.eclipse.core.runtime.PlatformObject;
-/**
- * @author aniefer
- */
public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPInternalBinding {
- public static class CPPNamespaceProblem extends ProblemBinding implements ICPPNamespace{
+ public static class CPPNamespaceProblem extends ProblemBinding implements ICPPNamespace, ICPPNamespaceScope{
public CPPNamespaceProblem(IASTNode node, int id, char[] arg) {
super(node, id, arg);
}
- public ICPPNamespaceScope getNamespaceScope() throws DOMException {
- throw new DOMException(this);
+ public ICPPNamespaceScope getNamespaceScope() {
+ return this;
}
- public IBinding[] getMemberBindings() throws DOMException {
- throw new DOMException(this);
+ public IBinding[] getMemberBindings() {
+ return IBinding.EMPTY_BINDING_ARRAY;
}
- public String[] getQualifiedName() throws DOMException {
- throw new DOMException(this);
+ public void addUsingDirective(ICPPUsingDirective usingDirective) {
}
- public char[][] getQualifiedNameCharArray() throws DOMException {
- throw new DOMException(this);
+ public ICPPUsingDirective[] getUsingDirectives() {
+ return ICPPUsingDirective.EMPTY_ARRAY;
}
- public boolean isGloballyQualified() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isInline() {
- return false;
+ public ICPPNamespaceScope[] getInlineNamespaces() {
+ return ICPPNamespaceScope.EMPTY_NAMESPACE_SCOPE_ARRAY;
}
}
@@ -98,7 +91,7 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
return (tu != null) ? tu : (IASTNode) namespaceDefinitions[0];
}
- static private class NamespaceCollector extends CPPASTVisitor {
+ static private class NamespaceCollector extends ASTVisitor {
private ICPPASTNamespaceDefinition namespaceDef = null;
private IASTName[] namespaces = null;
@@ -142,7 +135,7 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
}
}
- static private class NamespaceMemberCollector extends CPPASTVisitor {
+ static private class NamespaceMemberCollector extends ASTVisitor {
public ObjectSet<IBinding> members = new ObjectSet<IBinding>(8);
public NamespaceMemberCollector() {
shouldVisitNamespaces = true;
@@ -365,7 +358,7 @@ public class CPPNamespace extends PlatformObject implements ICPPNamespace, ICPPI
return ASTStringUtil.join(names, String.valueOf(Keywords.cpCOLONCOLON));
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
if (namespaceDefinitions != null && namespaceDefinitions.length > 0) {
return CPPVisitor.findDeclarationOwner(namespaceDefinitions[0], false);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceAlias.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceAlias.java
index 32ed7b0763..4bec0e288b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceAlias.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceAlias.java
@@ -36,7 +36,7 @@ public class CPPNamespaceAlias extends PlatformObject implements ICPPNamespaceAl
this.alias = aliasName;
}
- public ICPPNamespaceScope getNamespaceScope() throws DOMException {
+ public ICPPNamespaceScope getNamespaceScope() {
return namespace.getNamespaceScope();
}
@@ -88,7 +88,7 @@ public class CPPNamespaceAlias extends PlatformObject implements ICPPNamespaceAl
public void addDeclaration(IASTNode node) {
}
- public IBinding[] getMemberBindings() throws DOMException {
+ public IBinding[] getMemberBindings() {
return namespace.getMemberBindings();
}
@@ -96,7 +96,7 @@ public class CPPNamespaceAlias extends PlatformObject implements ICPPNamespaceAl
return Linkage.CPP_LINKAGE;
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return CPPVisitor.findDeclarationOwner(alias, false);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceScope.java
index 2eb1ea268c..09f5bc21a1 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPNamespaceScope.java
@@ -18,13 +18,13 @@ import java.util.Set;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.IName;
+import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.dom.ast.IScope;
-import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLinkageSpecification;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
@@ -106,7 +106,7 @@ public class CPPNamespaceScope extends CPPScope implements ICPPInternalNamespace
public IScope findNamespaceScope(IIndexScope scope) {
final String[] qname= scope.getScopeBinding().getQualifiedName();
final IScope[] result= {null};
- final CPPASTVisitor visitor= new CPPASTVisitor () {
+ final ASTVisitor visitor= new ASTVisitor () {
private int depth= 0;
{
shouldVisitNamespaces= shouldVisitDeclarations= true;
@@ -242,7 +242,6 @@ public class CPPNamespaceScope extends CPPScope implements ICPPInternalNamespace
} else if (getKind() == EScopeKind.eGlobal) {
inlineScopes= index.getInlineNamespaces();
}
- } catch (DOMException e) {
} catch (CoreException e) {
}
if (inlineScopes != null) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameter.java
index e4de53cd6f..5dc9c2e1c0 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameter.java
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
@@ -46,45 +45,6 @@ public class CPPParameter extends PlatformObject implements ICPPParameter, ICPPI
public CPPParameterProblem(IASTNode node, int id, char[] arg) {
super(node, id, arg);
}
- public IType getType() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isStatic() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isExtern() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isAuto() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isRegister() throws DOMException {
- throw new DOMException(this);
- }
- public boolean hasDefaultValue() {
- return false;
- }
- public boolean isMutable() 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 isExternC() {
- return false;
- }
- public IValue getInitialValue() {
- return null;
- }
- public boolean isParameterPack() {
- return false;
- }
}
private IType fType = null;
@@ -315,7 +275,7 @@ public class CPPParameter extends PlatformObject implements ICPPParameter, ICPPI
return name.length() != 0 ? name : "<unnamed>"; //$NON-NLS-1$
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return CPPVisitor.findEnclosingFunction(fDeclarations[0]);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterSpecialization.java
index b7bd1409b5..23ab59c190 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPParameterSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
@@ -68,14 +68,14 @@ public class CPPParameterSpecialization extends CPPSpecialization implements ICP
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IVariable#isAuto()
*/
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return getParameter().isAuto();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IVariable#isRegister()
*/
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return getParameter().isRegister();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScope.java
index 8fd5fb4797..43b600965d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScope.java
@@ -82,7 +82,7 @@ abstract public class CPPScope implements ICPPASTInternalScope {
}
@SuppressWarnings({ "unchecked" })
- public void addName(IASTName name) throws DOMException {
+ public void addName(IASTName name) {
// don't add inactive names to the scope
if (!name.isActive())
return;
@@ -141,7 +141,7 @@ abstract public class CPPScope implements ICPPASTInternalScope {
}
}
- public IBinding getBinding(IASTName name, boolean forceResolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean forceResolve, IIndexFileSet fileSet) {
IBinding binding= getBindingInAST(name, forceResolve);
if (binding == null && forceResolve) {
final IASTTranslationUnit tu = name.getTranslationUnit();
@@ -190,17 +190,17 @@ abstract public class CPPScope implements ICPPASTInternalScope {
return fIndexNamespace;
}
- public IBinding getBindingInAST(IASTName name, boolean forceResolve) throws DOMException {
+ public IBinding getBindingInAST(IASTName name, boolean forceResolve) {
IBinding[] bs= getBindingsInAST(name, forceResolve, false, false, true);
return CPPSemantics.resolveAmbiguities(name, bs);
}
- public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
+ public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
return getBindings(name, resolve, prefixLookup, fileSet, true);
}
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet,
- boolean checkPointOfDecl) throws DOMException {
+ boolean checkPointOfDecl) {
IBinding[] result = getBindingsInAST(name, resolve, prefixLookup, checkPointOfDecl, true);
final IASTTranslationUnit tu = name.getTranslationUnit();
if (tu != null) {
@@ -243,7 +243,7 @@ abstract public class CPPScope implements ICPPASTInternalScope {
}
public IBinding[] getBindingsInAST(IASTName name, boolean forceResolve, boolean prefixLookup,
- boolean checkPointOfDecl, boolean expandUsingDirectives) throws DOMException {
+ boolean checkPointOfDecl, boolean expandUsingDirectives) {
populateCache();
final char[] c = name.getLookupKey();
IBinding[] result = null;
@@ -327,7 +327,7 @@ abstract public class CPPScope implements ICPPASTInternalScope {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.IScope#find(java.lang.String)
*/
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
return CPPSemantics.findBindings(this, name, false);
}
@@ -354,26 +354,21 @@ abstract public class CPPScope implements ICPPASTInternalScope {
}
}
- public final IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
+ public final IBinding getBinding(IASTName name, boolean resolve) {
return getBinding(name, resolve, IIndexFileSet.EMPTY);
}
- public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) throws DOMException {
+ public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) {
return getBindings(name, resolve, prefix, IIndexFileSet.EMPTY, true);
}
- public IName getScopeName() throws DOMException {
+ public IName getScopeName() {
return null;
}
@Override
public String toString() {
- IName name = null;
- try {
- name = getScopeName();
- } catch (DOMException e) {
- }
-
+ IName name = getScopeName();
final String n= name != null ? name.toString() : "<unnamed scope>"; //$NON-NLS-1$
return getKind().toString() + ' ' + n + ' ' + '(' + super.toString() + ')';
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java
index 479d90d1ad..42929385ba 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java
@@ -88,19 +88,19 @@ public class CPPScopeMapper {
return fScope.getKind();
}
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
return fScope.find(name);
}
- public IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve) {
return fScope.getBinding(name, resolve);
}
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings) {
return fScope.getBinding(name, resolve, acceptLocalBindings);
}
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup) throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup) {
return fScope.getBindings(name, resolve, prefixLookup);
}
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet acceptLocalBindings) throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet acceptLocalBindings) {
return fScope.getBindings(name, resolve, prefixLookup, acceptLocalBindings);
}
public IScope getParent() throws DOMException {
@@ -111,7 +111,7 @@ public class CPPScopeMapper {
return fTu.getScope();
}
- public IName getScopeName() throws DOMException {
+ public IName getScopeName() {
return fScope.getScopeName();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java
index c7ed9ffeaa..28b4001370 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateDefinition.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM - Initial API and implementation
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -43,9 +43,6 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.core.runtime.PlatformObject;
-/**
- * @author aniefer
- */
public abstract class CPPTemplateDefinition extends PlatformObject implements ICPPTemplateDefinition, ICPPInternalTemplate {
public static final class CPPTemplateProblem extends ProblemBinding implements ICPPTemplateDefinition {
public CPPTemplateProblem(IASTNode node, int id, char[] arg) {
@@ -57,15 +54,6 @@ public abstract class CPPTemplateDefinition extends PlatformObject implements IC
public ICPPClassTemplatePartialSpecialization[] getTemplateSpecializations() 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);
- }
}
protected IASTName[] declarations;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java
index 83a4ecb342..7a05f896c9 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateNonTypeParameter.java
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
import org.eclipse.cdt.core.dom.ast.IASTEqualsInitializer;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
@@ -115,16 +114,16 @@ public class CPPTemplateNonTypeParameter extends CPPTemplateParameter implements
return getType() instanceof ICPPParameterPackType;
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return false;
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return false;
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return false;
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return false;
}
public IValue getInitialValue() {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameter.java
index a1a4cb5c6d..e53e0ff548 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateParameter.java
@@ -218,7 +218,7 @@ public abstract class CPPTemplateParameter extends PlatformObject
return getName();
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
if (declarations == null || declarations.length == 0)
return null;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateScope.java
index 702635cfdf..6057105f84 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateScope.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM - Initial API and implementation
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -21,9 +21,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateScope;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
-/**
- * @author aniefer
- */
public class CPPTemplateScope extends CPPScope implements ICPPTemplateScope {
public CPPTemplateScope(IASTNode physicalNode) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java
index ac1d745c24..104449d07c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTemplateTemplateParameter.java
@@ -126,39 +126,39 @@ public class CPPTemplateTemplateParameter extends CPPTemplateParameter implement
public ICPPBase[] getBases() {
return ICPPBase.EMPTY_BASE_ARRAY;
}
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
return IField.EMPTY_FIELD_ARRAY;
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
return null;
}
- public ICPPField[] getDeclaredFields() throws DOMException {
+ public ICPPField[] getDeclaredFields() {
return ICPPField.EMPTY_CPPFIELD_ARRAY;
}
- public ICPPMethod[] getMethods() throws DOMException {
+ public ICPPMethod[] getMethods() {
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
}
- public ICPPMethod[] getAllDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getAllDeclaredMethods() {
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
}
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getDeclaredMethods() {
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
}
public ICPPConstructor[] getConstructors() {
return ICPPConstructor.EMPTY_CONSTRUCTOR_ARRAY;
}
- public IBinding[] getFriends() throws DOMException {
+ public IBinding[] getFriends() {
return IBinding.EMPTY_BINDING_ARRAY;
}
public ICPPClassType[] getNestedClasses() {
return ICPPClassType.EMPTY_CLASS_ARRAY;
}
- public int getKey() throws DOMException {
+ public int getKey() {
return 0;
}
- public IScope getCompositeScope() throws DOMException {
+ public IScope getCompositeScope() {
return null;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java
index b05ea3a7db..39d7862d36 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPTypedef.java
@@ -1,13 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -29,9 +29,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.core.runtime.PlatformObject;
-/**
- * @author aniefer
- */
public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContainer, ICPPInternalBinding {
private IASTName[] declarations = null;
@@ -195,7 +192,7 @@ public class CPPTypedef extends PlatformObject implements ITypedef, ITypeContain
return getName();
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
if (declarations != null && declarations.length > 0) {
return CPPVisitor.findDeclarationOwner(declarations[0], true);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java
index cb87541778..406f9392e7 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownBinding.java
@@ -92,7 +92,7 @@ public class CPPUnknownBinding extends PlatformObject
return null;
}
- public ICPPScope asScope() throws DOMException {
+ public ICPPScope asScope() {
if (unknownScope == null) {
unknownScope = new CPPUnknownScope(this, name);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java
index 6e759f5ec3..d73abf4e42 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClass.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
@@ -12,7 +12,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope;
@@ -73,11 +72,11 @@ public class CPPUnknownClass extends CPPUnknownBinding implements ICPPUnknownCla
return IBinding.EMPTY_BINDING_ARRAY;
}
- public int getKey() throws DOMException{
+ public int getKey(){
return 0;
}
- public final IScope getCompositeScope() throws DOMException {
+ public final IScope getCompositeScope() {
return asScope();
}
@@ -93,13 +92,10 @@ public class CPPUnknownClass extends CPPUnknownBinding implements ICPPUnknownCla
&& !(type instanceof ICPPDeferredClassInstance)) {
ICPPUnknownClassType rhs= (ICPPUnknownClassType) type;
if (CharArrayUtils.equals(getNameCharArray(), rhs.getNameCharArray())) {
- try {
- final IBinding lhsContainer = getOwner();
- final IBinding rhsContainer = rhs.getOwner();
- if (lhsContainer instanceof IType && rhsContainer instanceof IType) {
- return ((IType) lhsContainer).isSameType((IType) rhsContainer);
- }
- } catch (DOMException e) {
+ final IBinding lhsContainer = getOwner();
+ final IBinding rhsContainer = rhs.getOwner();
+ if (lhsContainer instanceof IType && rhsContainer instanceof IType) {
+ return ((IType) lhsContainer).isSameType((IType) rhsContainer);
}
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClassInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClassInstance.java
index 470ac4028f..0f3c3af458 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClassInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownClassInstance.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Google, Inc and others.
+ * Copyright (c) 2008, 2010 Google, Inc 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
@@ -67,13 +66,10 @@ public class CPPUnknownClassInstance extends CPPUnknownClass implements ICPPUnkn
return false;
}
}
- try {
- final IBinding lhsContainer = getOwner();
- final IBinding rhsContainer = rhs.getOwner();
- if (lhsContainer instanceof IType && rhsContainer instanceof IType) {
- return (((IType)lhsContainer).isSameType((IType) rhsContainer));
- }
- } catch (DOMException e) {
+ final IBinding lhsContainer = getOwner();
+ final IBinding rhsContainer = rhs.getOwner();
+ if (lhsContainer instanceof IType && rhsContainer instanceof IType) {
+ return (((IType)lhsContainer).isSameType((IType) rhsContainer));
}
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownConstructor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownConstructor.java
index b056ad673e..85bf91bb0c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownConstructor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownConstructor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2008, 2010 Wind River Systems, Inc. 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
@@ -24,7 +23,7 @@ public class CPPUnknownConstructor extends CPPUnknownFunction implements ICPPCon
super(owner, owner.getNameCharArray());
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return false;
}
@@ -36,19 +35,19 @@ public class CPPUnknownConstructor extends CPPUnknownFunction implements ICPPCon
return false;
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return false;
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return false;
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
return (ICPPClassType) getOwner();
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return v_public;
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownFunction.java
index a023ffe410..183fc520df 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownFunction.java
@@ -39,7 +39,7 @@ public class CPPUnknownFunction extends CPPUnknownBinding implements ICPPFunctio
super(owner, name);
}
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
return null;
}
@@ -47,15 +47,15 @@ public class CPPUnknownFunction extends CPPUnknownBinding implements ICPPFunctio
return false;
}
- public boolean isExternC() throws DOMException {
+ public boolean isExternC() {
return false;
}
- public boolean isInline() throws DOMException {
+ public boolean isInline() {
return false;
}
- public boolean isMutable() throws DOMException {
+ public boolean isMutable() {
return false;
}
@@ -63,38 +63,38 @@ public class CPPUnknownFunction extends CPPUnknownBinding implements ICPPFunctio
return asScope();
}
- public ICPPParameter[] getParameters() throws DOMException {
+ public ICPPParameter[] getParameters() {
return ICPPParameter.EMPTY_CPPPARAMETER_ARRAY;
}
- public ICPPFunctionType getType() throws DOMException {
+ public ICPPFunctionType getType() {
if (fType == null) {
fType= new CPPUnknownFunctionType();
}
return fType;
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return false;
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return false;
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return false;
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return false;
}
- public boolean takesVarArgs() throws DOMException {
+ public boolean takesVarArgs() {
return false;
}
- public int getRequiredArgumentCount() throws DOMException {
+ public int getRequiredArgumentCount() {
return 0;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownScope.java
index f90408c2f8..6bfd13c52f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUnknownScope.java
@@ -13,7 +13,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.IName;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
@@ -22,13 +21,13 @@ import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTConstructorChainInitializer;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamedTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTTemplateId;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTUsingDeclaration;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
-import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier.ICPPASTBaseSpecifier;
import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.core.parser.util.CharArrayObjectMap;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
@@ -86,7 +85,7 @@ public class CPPUnknownScope implements ICPPInternalUnknownScope {
public void addName(IASTName name) {
}
- public final IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
+ public final IBinding getBinding(IASTName name, boolean resolve) {
return getBinding(name, resolve, IIndexFileSet.EMPTY);
}
@@ -157,7 +156,7 @@ public class CPPUnknownScope implements ICPPInternalUnknownScope {
return result;
}
- public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) throws DOMException {
+ public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) {
return getBindings(name, resolve, prefix, IIndexFileSet.EMPTY);
}
@@ -168,15 +167,11 @@ public class CPPUnknownScope implements ICPPInternalUnknownScope {
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet acceptLocalBindings, boolean checkPointOfDecl) {
if (prefixLookup) {
if (binding instanceof ICPPDeferredClassInstance) {
- try {
- ICPPDeferredClassInstance instance = (ICPPDeferredClassInstance) binding;
- IScope scope = instance.getClassTemplate().getCompositeScope();
- if (scope != null) {
- return scope.getBindings(name, resolve, prefixLookup, acceptLocalBindings);
- }
- } catch (DOMException exc) {
- CCorePlugin.log(exc);
- }
+ ICPPDeferredClassInstance instance = (ICPPDeferredClassInstance) binding;
+ IScope scope = instance.getClassTemplate().getCompositeScope();
+ if (scope != null) {
+ return scope.getBindings(name, resolve, prefixLookup, acceptLocalBindings);
+ }
}
return IBinding.EMPTY_BINDING_ARRAY;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java
index f13a4db021..d4807ecdfd 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPUsingDeclaration.java
@@ -1,13 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
- * Markus Schorn (Wind River Systems)
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -25,9 +25,6 @@ import org.eclipse.cdt.internal.core.dom.Linkage;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.core.runtime.PlatformObject;
-/**
- * @author aniefer
- */
public class CPPUsingDeclaration extends PlatformObject implements ICPPUsingDeclaration, ICPPInternalBinding {
private IASTName name;
private IBinding[] delegates;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVariable.java
index f3072075cc..e196cfb1a0 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVariable.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPVariable.java
@@ -6,9 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
- * Markus Schorn (Wind River Systems)
- * Ed Swartz (Nokia)
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
+ * Ed Swartz (Nokia)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
@@ -47,49 +47,11 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
import org.eclipse.core.runtime.PlatformObject;
-/**
- * @author aniefer
- */
public class CPPVariable extends PlatformObject implements ICPPVariable, ICPPInternalBinding, IInternalVariable {
public static class CPPVariableProblem extends ProblemBinding implements ICPPVariable {
public CPPVariableProblem(IASTNode node, int id, char[] arg) {
super(node, id, arg);
}
-
- public IType 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 isMutable() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isExtern() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isExternC() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isAuto() throws DOMException {
- throw new DOMException(this);
- }
- public boolean isRegister() throws DOMException {
- throw new DOMException(this);
- }
- public IValue getInitialValue() {
- return null;
- }
}
private IASTName fDefinition = null;
@@ -362,7 +324,7 @@ public class CPPVariable extends PlatformObject implements ICPPVariable, ICPPInt
return Linkage.CPP_LINKAGE;
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
IASTName node = fDefinition != null ? fDefinition : fDeclarations[0];
return CPPVisitor.findNameOwner(node, !hasStorageClass(IASTDeclSpecifier.sc_extern));
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java
index 07dc5eda2a..7e91d3e025 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java
@@ -63,7 +63,6 @@ import org.eclipse.cdt.core.parser.util.ObjectSet;
import org.eclipse.cdt.internal.core.dom.parser.ASTInternal;
import org.eclipse.cdt.internal.core.dom.parser.ASTQueries;
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
-import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType.CPPClassTypeProblem;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
@@ -81,11 +80,9 @@ public class ClassTypeHelper {
if (host.getDefinition() == null) {
host.checkForDefinition();
if (host.getDefinition() == null) {
- try {
- ICPPClassType backup= getBackupDefinition(host);
- if (backup != null)
- return backup.getFriends();
- } catch (DOMException e) {}
+ ICPPClassType backup= getBackupDefinition(host);
+ if (backup != null)
+ return backup.getFriends();
IASTNode[] declarations= host.getDeclarations();
IASTNode node = (declarations != null && declarations.length > 0) ? declarations[0] : null;
return new IBinding[] { new ProblemBinding(node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, host.getNameCharArray()) };
@@ -163,7 +160,7 @@ public class ClassTypeHelper {
* A host maybe backed up with a definition from the index.
* @throws DOMException
*/
- private static ICPPClassType getBackupDefinition(ICPPInternalClassTypeMixinHost host) throws DOMException {
+ private static ICPPClassType getBackupDefinition(ICPPInternalClassTypeMixinHost host) {
ICPPClassScope scope = host.getCompositeScope();
if (scope != null) {
ICPPClassType b = scope.getClassType();
@@ -177,15 +174,11 @@ public class ClassTypeHelper {
if (host.getDefinition() == null) {
host.checkForDefinition();
if (host.getDefinition() == null) {
- try {
- ICPPClassType backup= getBackupDefinition(host);
- if (backup != null)
- return backup.getBases();
- } catch (DOMException e) {}
+ ICPPClassType backup= getBackupDefinition(host);
+ if (backup != null)
+ return backup.getBases();
- IASTNode[] declarations= host.getDeclarations();
- IASTNode node = (declarations != null && declarations.length > 0) ? declarations[0] : null;
- return new ICPPBase[] { new CPPBaseClause.CPPBaseProblem(node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, host.getNameCharArray()) };
+ return ICPPBase.EMPTY_BASE_ARRAY;
}
}
ICPPASTBaseSpecifier[] bases = host.getCompositeTypeSpecifier().getBaseSpecifiers();
@@ -200,19 +193,15 @@ public class ClassTypeHelper {
return bindings;
}
- public static ICPPField[] getDeclaredFields(ICPPInternalClassTypeMixinHost host) throws DOMException {
+ public static ICPPField[] getDeclaredFields(ICPPInternalClassTypeMixinHost host) {
if (host.getDefinition() == null) {
host.checkForDefinition();
if (host.getDefinition() == null) {
- try {
- ICPPClassType backup= getBackupDefinition(host);
- if (backup != null)
- return backup.getDeclaredFields();
- } catch (DOMException e) {}
+ ICPPClassType backup= getBackupDefinition(host);
+ if (backup != null)
+ return backup.getDeclaredFields();
- IASTNode[] declarations= host.getDeclarations();
- IASTNode node = (declarations != null && declarations.length > 0) ? declarations[0] : null;
- return new ICPPField[] { new CPPField.CPPFieldProblem(node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, host.getNameCharArray()) };
+ return ICPPField.EMPTY_CPPFIELD_ARRAY;
}
}
IBinding binding = null;
@@ -248,9 +237,8 @@ public class ClassTypeHelper {
* Returns all direct and indirect base classes that have at least a given visibility level.
* @param classType a class
* @return An array of visible base classes in arbitrary order.
- * @throws DOMException
*/
- public static ICPPClassType[] getAllBases(ICPPClassType classType) throws DOMException {
+ public static ICPPClassType[] getAllBases(ICPPClassType classType) {
HashSet<ICPPClassType> result= new HashSet<ICPPClassType>();
result.add(classType);
getAllBases(classType, result);
@@ -258,7 +246,7 @@ public class ClassTypeHelper {
return result.toArray(new ICPPClassType[result.size()]);
}
- private static void getAllBases(ICPPClassType classType, HashSet<ICPPClassType> result) throws DOMException {
+ private static void getAllBases(ICPPClassType classType, HashSet<ICPPClassType> result) {
ICPPBase[] bases= classType.getBases();
for (ICPPBase base : bases) {
IBinding b= base.getBaseClass();
@@ -271,7 +259,7 @@ public class ClassTypeHelper {
}
}
- public static ICPPMethod[] getAllDeclaredMethods(ICPPClassType ct) throws DOMException {
+ public static ICPPMethod[] getAllDeclaredMethods(ICPPClassType ct) {
ICPPMethod[] methods= ct.getDeclaredMethods();
ICPPClassType[] bases= getAllBases(ct);
for (ICPPClassType base : bases) {
@@ -280,7 +268,7 @@ public class ClassTypeHelper {
return (ICPPMethod[]) ArrayUtil.trim(ICPPMethod.class, methods);
}
- public static ICPPMethod[] getMethods(ICPPClassType ct) throws DOMException {
+ public static ICPPMethod[] getMethods(ICPPClassType ct) {
ObjectSet<ICPPMethod> set= new ObjectSet<ICPPMethod>(4);
set.addAll(ct.getDeclaredMethods());
ICPPClassScope scope= (ICPPClassScope) ct.getCompositeScope();
@@ -297,7 +285,7 @@ public class ClassTypeHelper {
return set.keyArray(ICPPMethod.class);
}
- public static ICPPMethod[] getDeclaredMethods(ICPPInternalClassTypeMixinHost host) throws DOMException {
+ public static ICPPMethod[] getDeclaredMethods(ICPPInternalClassTypeMixinHost host) {
if (host.getDefinition() == null) {
host.checkForDefinition();
if (host.getDefinition() == null) {
@@ -305,9 +293,7 @@ public class ClassTypeHelper {
if (backup != null)
return backup.getDeclaredMethods();
- IASTNode[] declarations= host.getDeclarations();
- IASTNode node = (declarations != null && declarations.length > 0) ? declarations[0] : null;
- return new ICPPMethod[] { new CPPMethod.CPPMethodProblem(node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, host.getNameCharArray()) };
+ return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
}
}
IBinding binding = null;
@@ -357,12 +343,10 @@ public class ClassTypeHelper {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType#getConstructors()
*/
- public static ICPPConstructor[] getConstructors(ICPPInternalClassTypeMixinHost host) throws DOMException {
+ public static ICPPConstructor[] getConstructors(ICPPInternalClassTypeMixinHost host) {
ICPPClassScope scope = host.getCompositeScope();
if (scope == null) {
- IASTNode[] declarations= host.getDeclarations();
- IASTNode node = (declarations != null && declarations.length > 0) ? declarations[0] : null;
- return new ICPPConstructor[] { new CPPConstructor.CPPConstructorProblem(node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, host.getNameCharArray()) };
+ return ICPPConstructor.EMPTY_CONSTRUCTOR_ARRAY;
}
return scope.getConstructors();
}
@@ -371,15 +355,11 @@ public class ClassTypeHelper {
if (host.getDefinition() == null) {
host.checkForDefinition();
if (host.getDefinition() == null) {
- try {
- ICPPClassType backup= getBackupDefinition(host);
- if (backup != null)
- return backup.getNestedClasses();
- } catch (DOMException e) {}
+ ICPPClassType backup= getBackupDefinition(host);
+ if (backup != null)
+ return backup.getNestedClasses();
- IASTNode[] declarations= host.getDeclarations();
- IASTNode node = (declarations != null && declarations.length > 0) ? declarations[0] : null;
- return new ICPPClassType[] { new CPPClassTypeProblem(node, IProblemBinding.SEMANTIC_DEFINITION_NOT_FOUND, host.getNameCharArray()) };
+ return ICPPClassType.EMPTY_CLASS_ARRAY;
}
}
@@ -405,7 +385,7 @@ public class ClassTypeHelper {
return (ICPPClassType[]) ArrayUtil.trim(ICPPClassType.class, result);
}
- public static IField[] getFields(ICPPClassType ct) throws DOMException {
+ public static IField[] getFields(ICPPClassType ct) {
IField[] fields = ct.getDeclaredFields();
ICPPClassType[] bases = getAllBases(ct);
for (ICPPClassType base : bases) {
@@ -414,7 +394,7 @@ public class ClassTypeHelper {
return (IField[]) ArrayUtil.trim(IField.class, fields);
}
- public static IField findField(ICPPClassType ct, String name) throws DOMException {
+ public static IField findField(ICPPClassType ct, String name) {
IBinding[] bindings = CPPSemantics.findBindings(ct.getCompositeScope(), name, true);
IField field = null;
for (IBinding binding : bindings) {
@@ -424,7 +404,7 @@ public class ClassTypeHelper {
} else {
IASTNode[] decls= ASTInternal.getDeclarationsOfBinding(ct);
IASTNode node= (decls != null && decls.length > 0) ? decls[0] : null;
- return new CPPField.CPPFieldProblem(node, IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, name.toCharArray());
+ return new CPPField.CPPFieldProblem(ct, node, IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, name.toCharArray());
}
}
}
@@ -659,9 +639,8 @@ public class ClassTypeHelper {
/**
* For implicit methods the exception specification is inherited, search it
- * @throws DOMException
*/
- public static IType[] getInheritedExceptionSpecification(ICPPMethod implicitMethod) throws DOMException {
+ public static IType[] getInheritedExceptionSpecification(ICPPMethod implicitMethod) {
// See 15.4.13
ICPPClassType owner= implicitMethod.getClassOwner();
if (owner == null || owner.getBases().length == 0)
@@ -690,40 +669,43 @@ public class ClassTypeHelper {
return inheritedTypeids.toArray(new IType[inheritedTypeids.size()]);
}
- private static int getImplicitMethodKind(ICPPClassType ct, ICPPMethod method) throws DOMException {
- if (method instanceof ICPPConstructor) {
- final IFunctionType type= method.getType();
- final IType[] params= type.getParameterTypes();
- if (params.length == 0)
- return KIND_DEFAULT_CTOR;
- if (params.length == 1) {
- IType t= SemanticUtil.getNestedType(params[0], SemanticUtil.TDEF);
- if (SemanticUtil.isVoidType(t))
+ private static int getImplicitMethodKind(ICPPClassType ct, ICPPMethod method) {
+ try {
+ if (method instanceof ICPPConstructor) {
+ final IFunctionType type= method.getType();
+ final IType[] params= type.getParameterTypes();
+ if (params.length == 0)
return KIND_DEFAULT_CTOR;
+ if (params.length == 1) {
+ IType t= SemanticUtil.getNestedType(params[0], SemanticUtil.TDEF);
+ if (SemanticUtil.isVoidType(t))
+ return KIND_DEFAULT_CTOR;
- if (isRefToConstClass(ct, t))
- return KIND_COPY_CTOR;
+ if (isRefToConstClass(ct, t))
+ return KIND_COPY_CTOR;
+ }
+ return KIND_OTHER;
}
- return KIND_OTHER;
- }
-
- if (method.isDestructor())
- return KIND_DTOR;
-
- if (CharArrayUtils.equals(method.getNameCharArray(), OverloadableOperator.ASSIGN.toCharArray())) {
- final IFunctionType type= method.getType();
- final IType[] params= type.getParameterTypes();
- if (params.length == 1) {
- IType t= params[0];
- if (isRefToConstClass(ct, t))
- return KIND_ASSIGNMENT_OP;
+
+ if (method.isDestructor())
+ return KIND_DTOR;
+
+ if (CharArrayUtils.equals(method.getNameCharArray(), OverloadableOperator.ASSIGN.toCharArray())) {
+ final IFunctionType type= method.getType();
+ final IType[] params= type.getParameterTypes();
+ if (params.length == 1) {
+ IType t= params[0];
+ if (isRefToConstClass(ct, t))
+ return KIND_ASSIGNMENT_OP;
+ }
+ return KIND_OTHER;
}
- return KIND_OTHER;
+ } catch (DOMException e) {
}
return KIND_OTHER;
}
- private static boolean isRefToConstClass(ICPPClassType ct, IType t) throws DOMException {
+ private static boolean isRefToConstClass(ICPPClassType ct, IType t) {
while (t instanceof ITypedef)
t= ((ITypedef) t).getType();
@@ -739,7 +721,7 @@ public class ClassTypeHelper {
return false;
}
- private static ICPPMethod getMethodInClass(ICPPClassType ct, int kind) throws DOMException {
+ private static ICPPMethod getMethodInClass(ICPPClassType ct, int kind) {
switch(kind) {
case KIND_DEFAULT_CTOR:
case KIND_COPY_CTOR:
@@ -772,7 +754,7 @@ public class ClassTypeHelper {
* no private or protected non-static data members (Clause 11),
* no base classes (Clause 10), and no virtual functions (10.3).
*/
- public static boolean isAggregateClass(ICPPClassType classTarget) throws DOMException {
+ public static boolean isAggregateClass(ICPPClassType classTarget) {
if (classTarget.getBases().length > 0)
return false;
ICPPMethod[] methods = classTarget.getDeclaredMethods();
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPASTInternalScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPASTInternalScope.java
index bb8d357c4f..7e22d3b3a5 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPASTInternalScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPASTInternalScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2008, 2010 Wind River Systems, Inc. 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IScope;
@@ -28,5 +27,5 @@ public interface ICPPASTInternalScope extends IASTInternalScope, ICPPScope {
* dependent bindings, where the points of declaration may be reversed.
*/
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup,
- IIndexFileSet acceptLocalBindings, boolean checkPointOfDecl) throws DOMException;
+ IIndexFileSet acceptLocalBindings, boolean checkPointOfDecl);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPClassSpecializationScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPClassSpecializationScope.java
index 925c298ff4..3a08656275 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPClassSpecializationScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPClassSpecializationScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2008, 2010 Wind River Systems, Inc. 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
@@ -39,25 +38,25 @@ public interface ICPPClassSpecializationScope extends ICPPClassScope {
/**
* Computes the bases via the original class.
*/
- ICPPBase[] getBases() throws DOMException;
+ ICPPBase[] getBases();
/**
* Computes the methods via the original class.
*/
- ICPPMethod[] getDeclaredMethods() throws DOMException;
+ ICPPMethod[] getDeclaredMethods();
/**
* Computes the fields via the original class.
*/
- ICPPField[] getDeclaredFields() throws DOMException;
+ ICPPField[] getDeclaredFields();
/**
* Computes the friends via the original class.
*/
- IBinding[] getFriends() throws DOMException;
+ IBinding[] getFriends();
/**
* Computes the nested classes via the original class.
*/
- ICPPClassType[] getNestedClasses() throws DOMException;
+ ICPPClassType[] getNestedClasses();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalClassTypeMixinHost.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalClassTypeMixinHost.java
index 9fc715d74a..187a3a94e1 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalClassTypeMixinHost.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ICPPInternalClassTypeMixinHost.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
@@ -27,7 +26,7 @@ interface ICPPInternalClassTypeMixinHost extends ICPPClassType, ICPPInternalBind
/**
* {@inheritDoc}
*/
- ICPPClassScope getCompositeScope() throws DOMException;
+ ICPPClassScope getCompositeScope();
/**
* Ensures the ICPPInternalBinding definition is set, if this is possible.
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AccessContext.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AccessContext.java
index 2b66eb2e02..11af1fb58f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AccessContext.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AccessContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Google, Inc and others.
+ * Copyright (c) 2009, 2010 Google, Inc 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
@@ -111,11 +111,7 @@ public class AccessContext {
return false;
}
}
- try {
- namingClass = getNamingClass(accessOwner);
- } catch (DOMException e) {
- return false;
- }
+ namingClass = getNamingClass(accessOwner);
return true;
}
@@ -222,7 +218,7 @@ public class AccessContext {
}
- private ICPPClassType getNamingClass(ICPPClassType accessOwner) throws DOMException {
+ private ICPPClassType getNamingClass(ICPPClassType accessOwner) {
ICPPClassType classType = firstCandidateForNamingClass;
if (classType != null && isUnqualifiedLookup) {
IBinding owner = classType.getOwner();
@@ -239,28 +235,22 @@ public class AccessContext {
return true;
}
if (maxdepth > 0) {
- try {
- for (ICPPBase cppBase : derived.getBases()) {
- try {
- IBinding base= cppBase.getBaseClass();
- if (base instanceof ICPPClassType) {
- ICPPClassType tbase= (ICPPClassType) base;
- if (tbase.isSameType(target)) {
- return true;
- }
- if (derivesFrom(tbase, target, maxdepth - 1))
- return true;
- }
- } catch (DOMException e) {
+ for (ICPPBase cppBase : derived.getBases()) {
+ IBinding base= cppBase.getBaseClass();
+ if (base instanceof ICPPClassType) {
+ ICPPClassType tbase= (ICPPClassType) base;
+ if (tbase.isSameType(target)) {
+ return true;
}
+ if (derivesFrom(tbase, target, maxdepth - 1))
+ return true;
}
- } catch (DOMException e) {
}
}
return false;
}
- private static IBinding[] getContext(IASTName name) throws DOMException {
+ private static IBinding[] getContext(IASTName name) {
IBinding[] accessibilityContext = IBinding.EMPTY_BINDING_ARRAY;
for (IBinding binding = CPPVisitor.findEnclosingFunctionOrClass(name);
binding != null; binding = binding.getOwner()) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AutoTypeResolver.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AutoTypeResolver.java
index 9c90dff47e..5b9c33ecc6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AutoTypeResolver.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AutoTypeResolver.java
@@ -51,15 +51,15 @@ class AutoTypeResolver implements ICPPFunctionTemplate {
return functionType;
}
- public boolean isMutable() throws DOMException {
+ public boolean isMutable() {
return false;
}
- public boolean isInline() throws DOMException {
+ public boolean isInline() {
return false;
}
- public boolean isExternC() throws DOMException {
+ public boolean isExternC() {
return false;
}
@@ -67,8 +67,8 @@ class AutoTypeResolver implements ICPPFunctionTemplate {
return false;
}
- public IType[] getExceptionSpecification() throws DOMException {
- return IType.EMPTY_TYPE_ARRAY;
+ public IType[] getExceptionSpecification() {
+ return null;
}
public ICPPParameter[] getParameters() throws DOMException {
@@ -87,23 +87,23 @@ class AutoTypeResolver implements ICPPFunctionTemplate {
throw new UnsupportedOperationException(UNEXPECTED_CALL);
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return false;
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return false;
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return false;
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return false;
}
- public boolean takesVarArgs() throws DOMException {
+ public boolean takesVarArgs() {
return false;
}
@@ -119,7 +119,7 @@ class AutoTypeResolver implements ICPPFunctionTemplate {
throw new UnsupportedOperationException(UNEXPECTED_CALL);
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
throw new UnsupportedOperationException(UNEXPECTED_CALL);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java
index 33ef875bb6..c71f933b23 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/BaseClassLookup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2009, 2010 Wind River Systems, Inc. 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
@@ -124,12 +124,8 @@ class BaseClassLookup {
if (binding == null)
return false;
if (binding instanceof ICPPMember) {
- try {
- if (!((ICPPMember) binding).isStatic())
- return true;
- } catch (DOMException e) {
- // treat as non-static
- }
+ if (!((ICPPMember) binding).isStatic())
+ return true;
}
}
return false;
@@ -158,11 +154,7 @@ class BaseClassLookup {
IBinding[] matches= IBinding.EMPTY_BINDING_ARRAY;
if (baseClassScope == null) {
result= new BaseClassLookup(root);
- try {
- infoMap.put(root.getCompositeScope(), result);
- } catch (DOMException e) {
- // ignore
- }
+ infoMap.put(root.getCompositeScope(), result);
} else {
result= new BaseClassLookup(baseClassScope.getClassType());
infoMap.put(baseClassScope, result);
@@ -186,11 +178,7 @@ class BaseClassLookup {
ICPPClassType baseClass= result.getClassType();
if (baseClass != null) {
ICPPBase[] grandBases= null;
- try {
- grandBases= baseClass.getBases();
- } catch (DOMException e) {
- // assume that there are no bases
- }
+ grandBases= baseClass.getBases();
if (grandBases != null && grandBases.length > 0) {
HashSet<IBinding> grandBaseBindings= null;
BitSet selectedBases= null;
@@ -207,38 +195,34 @@ class BaseClassLookup {
if (selectedBases != null && !selectedBases.get(i))
continue;
- try {
- IBinding grandBaseBinding = grandBase.getBaseClass();
- if (!(grandBaseBinding instanceof ICPPClassType)) {
- // 14.6.2.3 scope is not examined
- if (grandBaseBinding instanceof ICPPUnknownBinding) {
- if (data.skippedScope == null)
- data.skippedScope= root;
- }
- continue;
- }
-
- final ICPPClassType grandBaseClass = (ICPPClassType) grandBaseBinding;
- if (grandBaseBindings != null && !grandBaseBindings.add(grandBaseClass))
- continue;
-
- final IScope grandBaseScope= grandBaseClass.getCompositeScope();
- if (grandBaseScope == null || grandBaseScope instanceof ICPPInternalUnknownScope) {
- // 14.6.2.3 scope is not examined
+ IBinding grandBaseBinding = grandBase.getBaseClass();
+ if (!(grandBaseBinding instanceof ICPPClassType)) {
+ // 14.6.2.3 scope is not examined
+ if (grandBaseBinding instanceof ICPPUnknownBinding) {
if (data.skippedScope == null)
data.skippedScope= root;
- continue;
}
- if (!(grandBaseScope instanceof ICPPClassScope))
- continue;
-
- BaseClassLookup baseInfo= lookupInBaseClass(data, (ICPPClassScope) grandBaseScope,
- grandBase.isVirtual(), root, fileSet, infoMap, depth);
- if (baseInfo != null)
- result.addBase(grandBase.isVirtual(), baseInfo);
- } catch (DOMException e) {
- // move on to next base
+ continue;
}
+
+ final ICPPClassType grandBaseClass = (ICPPClassType) grandBaseBinding;
+ if (grandBaseBindings != null && !grandBaseBindings.add(grandBaseClass))
+ continue;
+
+ final IScope grandBaseScope= grandBaseClass.getCompositeScope();
+ if (grandBaseScope == null || grandBaseScope instanceof ICPPInternalUnknownScope) {
+ // 14.6.2.3 scope is not examined
+ if (data.skippedScope == null)
+ data.skippedScope= root;
+ continue;
+ }
+ if (!(grandBaseScope instanceof ICPPClassScope))
+ continue;
+
+ BaseClassLookup baseInfo= lookupInBaseClass(data, (ICPPClassScope) grandBaseScope,
+ grandBase.isVirtual(), root, fileSet, infoMap, depth);
+ if (baseInfo != null)
+ result.addBase(grandBase.isVirtual(), baseInfo);
}
}
}
@@ -295,41 +279,33 @@ class BaseClassLookup {
if (fClassType != null) {
ICPPBase[] bases= null;
- try {
- bases= fClassType.getBases();
- } catch (DOMException e) {
- // assume that there are no bases
- }
+ bases= fClassType.getBases();
if (bases != null && bases.length > 0) {
for (ICPPBase base : bases) {
if (base instanceof IProblemBinding)
continue;
- try {
- IBinding baseBinding = base.getBaseClass();
- if (!(baseBinding instanceof ICPPClassType)) {
- continue;
- }
-
- final ICPPClassType baseClass = (ICPPClassType) baseBinding;
- final IScope baseScope= baseClass.getCompositeScope();
- if (!(baseScope instanceof ICPPClassScope))
- continue;
-
- BaseClassLookup baseInfo= infoMap.get(baseScope);
- if (baseInfo != null) {
- if (base.isVirtual()) {
- baseInfo.setHiddenAsVirtualBase();
- }
- baseInfo.propagateHiddenAsVirtual();
- } else {
- // mark to catch recursions
- baseInfo= new BaseClassLookup(baseClass);
- infoMap.put(baseScope, baseInfo);
- baseInfo.hideVirtualBases(infoMap, depth);
+ IBinding baseBinding = base.getBaseClass();
+ if (!(baseBinding instanceof ICPPClassType)) {
+ continue;
+ }
+
+ final ICPPClassType baseClass = (ICPPClassType) baseBinding;
+ final IScope baseScope= baseClass.getCompositeScope();
+ if (!(baseScope instanceof ICPPClassScope))
+ continue;
+
+ BaseClassLookup baseInfo= infoMap.get(baseScope);
+ if (baseInfo != null) {
+ if (base.isVirtual()) {
+ baseInfo.setHiddenAsVirtualBase();
}
- } catch (DOMException e) {
- // move on to next base
+ baseInfo.propagateHiddenAsVirtual();
+ } else {
+ // mark to catch recursions
+ baseInfo= new BaseClassLookup(baseClass);
+ infoMap.put(baseScope, baseInfo);
+ baseInfo.hideVirtualBases(infoMap, depth);
}
}
}
@@ -381,20 +357,16 @@ class BaseClassLookup {
ICPPClassType uniqueOwner= null;
for (IBinding b : bindings) {
if (!(b instanceof IType)) {
- try {
- IBinding owner= b.getOwner();
- if (owner instanceof ICPPClassType) {
- final ICPPClassType classOwner = (ICPPClassType) owner;
- if (uniqueOwner == null) {
- uniqueOwner= classOwner;
- } else if (!uniqueOwner.isSameType(classOwner)) {
- data.problem= new ProblemBinding(data.astName,
- IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, bindings);
- return;
- }
+ IBinding owner= b.getOwner();
+ if (owner instanceof ICPPClassType) {
+ final ICPPClassType classOwner = (ICPPClassType) owner;
+ if (uniqueOwner == null) {
+ uniqueOwner= classOwner;
+ } else if (!uniqueOwner.isSameType(classOwner)) {
+ data.problem= new ProblemBinding(data.astName,
+ IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, bindings);
+ return;
}
- } catch (DOMException e) {
- // ignore
}
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
index adfe0de5c7..658abb8b37 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
@@ -1070,15 +1070,12 @@ public class CPPSemantics {
}
if (b instanceof ICPPMember) {
ICPPMember mem= (ICPPMember) b;
- try {
- if (!mem.isStatic()) {
- ICPPClassType owner= mem.getClassOwner();
- if (owner instanceof ICPPUnknownBinding || owner instanceof ICPPTemplateDefinition) {
- result[0]= true;
- return PROCESS_ABORT;
- }
+ if (!mem.isStatic()) {
+ ICPPClassType owner= mem.getClassOwner();
+ if (owner instanceof ICPPUnknownBinding || owner instanceof ICPPTemplateDefinition) {
+ result[0]= true;
+ return PROCESS_ABORT;
}
- } catch (DOMException e) {
}
}
if (b instanceof IVariable) {
@@ -1308,12 +1305,7 @@ public class CPPSemantics {
public static void populateCache(ICPPASTInternalScope scope) {
IASTNode[] nodes = null;
- IASTNode parent;
- try {
- parent = ASTInternal.getPhysicalNodeOfScope(scope);
- } catch (DOMException e) {
- return;
- }
+ IASTNode parent= ASTInternal.getPhysicalNodeOfScope(scope);
IASTName[] namespaceDefs = null;
int namespaceIdx = -1;
@@ -2991,12 +2983,7 @@ public class CPPSemantics {
if (cls == null)
return null;
- IScope scope = null;
- try {
- scope = cls.getCompositeScope();
- } catch (DOMException e) {
- return null;
- }
+ IScope scope = cls.getCompositeScope();
if (scope == null)
return null;
@@ -3275,15 +3262,15 @@ public class CPPSemantics {
return type instanceof ICPPClassType || type instanceof IEnumeration;
}
- public static IBinding[] findBindings(IScope scope, String name, boolean qualified) throws DOMException {
+ public static IBinding[] findBindings(IScope scope, String name, boolean qualified) {
return findBindings(scope, name.toCharArray(), qualified, null);
}
- public static IBinding[] findBindings(IScope scope, char[] name, boolean qualified) throws DOMException {
+ public static IBinding[] findBindings(IScope scope, char[] name, boolean qualified) {
return findBindings(scope, name, qualified, null);
}
- public static IBinding[] findBindings(IScope scope, char[] name, boolean qualified, IASTNode beforeNode) throws DOMException {
+ public static IBinding[] findBindings(IScope scope, char[] name, boolean qualified, IASTNode beforeNode) {
CPPASTName astName = new CPPASTName();
astName.setName(name);
astName.setParent(ASTInternal.getPhysicalNodeOfScope(scope));
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
index 3188267109..7f15d18e67 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPTemplates.java
@@ -806,70 +806,66 @@ public class CPPTemplates {
}
private static int determinePackSize(IType type, ICPPTemplateParameterMap tpMap) {
- try {
- if (type instanceof ICPPFunctionType) {
- final ICPPFunctionType ft = (ICPPFunctionType) type;
- final IType rt = ft.getReturnType();
- int r = determinePackSize(rt, tpMap);
- if (r < 0)
- return r;
- IType[] ps = ft.getParameterTypes();
- for (IType pt : ps) {
- r= combine(r, determinePackSize(pt, tpMap));
- if (r < 0)
- return r;
- }
+ if (type instanceof ICPPFunctionType) {
+ final ICPPFunctionType ft = (ICPPFunctionType) type;
+ final IType rt = ft.getReturnType();
+ int r = determinePackSize(rt, tpMap);
+ if (r < 0)
return r;
- }
-
- if (type instanceof ICPPTemplateParameter) {
- final ICPPTemplateParameter tpar = (ICPPTemplateParameter) type;
- if (tpar.isParameterPack()) {
- ICPPTemplateArgument[] args= tpMap.getPackExpansion(tpar);
- if (args != null)
- return args.length;
- return PACK_SIZE_DEFER;
- }
- return PACK_SIZE_NOT_FOUND;
- }
-
- int r= PACK_SIZE_NOT_FOUND;
- if (type instanceof ICPPUnknownBinding) {
- if (type instanceof ICPPDeferredClassInstance) {
- ICPPDeferredClassInstance dcl= (ICPPDeferredClassInstance) type;
- ICPPTemplateArgument[] args = dcl.getTemplateArguments();
- for (ICPPTemplateArgument arg : args) {
- r= combine(r, determinePackSize(arg, tpMap));
- if (r < 0)
- return r;
- }
- }
- IBinding binding= ((ICPPUnknownBinding) type).getOwner();
- if (binding instanceof IType)
- r= combine(r, determinePackSize((IType) binding, tpMap));
+ IType[] ps = ft.getParameterTypes();
+ for (IType pt : ps) {
+ r= combine(r, determinePackSize(pt, tpMap));
+ if (r < 0)
+ return r;
+ }
+ return r;
+ }
- return r;
+ if (type instanceof ICPPTemplateParameter) {
+ final ICPPTemplateParameter tpar = (ICPPTemplateParameter) type;
+ if (tpar.isParameterPack()) {
+ ICPPTemplateArgument[] args= tpMap.getPackExpansion(tpar);
+ if (args != null)
+ return args.length;
+ return PACK_SIZE_DEFER;
}
+ return PACK_SIZE_NOT_FOUND;
+ }
- if (type instanceof ICPPParameterPackType)
- return PACK_SIZE_NOT_FOUND;
-
- if (type instanceof IArrayType) {
- IArrayType at= (IArrayType) type;
- IValue asize= at.getSize();
- r= determinePackSize(asize, tpMap);
- if (r < 0)
- return r;
+ int r= PACK_SIZE_NOT_FOUND;
+ if (type instanceof ICPPUnknownBinding) {
+ if (type instanceof ICPPDeferredClassInstance) {
+ ICPPDeferredClassInstance dcl= (ICPPDeferredClassInstance) type;
+ ICPPTemplateArgument[] args = dcl.getTemplateArguments();
+ for (ICPPTemplateArgument arg : args) {
+ r= combine(r, determinePackSize(arg, tpMap));
+ if (r < 0)
+ return r;
+ }
}
+ IBinding binding= ((ICPPUnknownBinding) type).getOwner();
+ if (binding instanceof IType)
+ r= combine(r, determinePackSize((IType) binding, tpMap));
- if (type instanceof ITypeContainer) {
- final ITypeContainer typeContainer = (ITypeContainer) type;
- r= combine(r, determinePackSize(typeContainer.getType(), tpMap));
- }
return r;
- } catch (DOMException e) {
- return PACK_SIZE_FAIL;
}
+
+ if (type instanceof ICPPParameterPackType)
+ return PACK_SIZE_NOT_FOUND;
+
+ if (type instanceof IArrayType) {
+ IArrayType at= (IArrayType) type;
+ IValue asize= at.getSize();
+ r= determinePackSize(asize, tpMap);
+ if (r < 0)
+ return r;
+ }
+
+ if (type instanceof ITypeContainer) {
+ final ITypeContainer typeContainer = (ITypeContainer) type;
+ r= combine(r, determinePackSize(typeContainer.getType(), tpMap));
+ }
+ return r;
}
private static int combine(int ps1, int ps2) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
index 1856216033..b21c6d3522 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPVisitor.java
@@ -214,6 +214,9 @@ public class CPPVisitor extends ASTQueries {
parent instanceof ICPPASTBaseSpecifier ||
parent instanceof ICPPASTConstructorChainInitializer ||
name.getPropertyInParent() == ICPPASTNamespaceAlias.MAPPING_NAME) {
+ if (name.getLookupKey().length == 0)
+ return null;
+
binding = CPPSemantics.resolveBinding(name);
if (binding instanceof IProblemBinding && parent instanceof ICPPASTQualifiedName &&
!(parent.getParent() instanceof ICPPASTNamespaceAlias)) {
@@ -222,6 +225,9 @@ public class CPPVisitor extends ASTQueries {
if (ns[ns.length - 1] != name)
return binding;
+ if (ns.length > 1 && ns[ns.length-2].getBinding() instanceof IProblemBinding)
+ return binding;
+
parent = parent.getParent();
if (((IProblemBinding) binding).getID() == IProblemBinding.SEMANTIC_MEMBER_DECLARATION_NOT_FOUND) {
IASTNode node = getContainingBlockItem(name.getParent());
@@ -294,15 +300,11 @@ public class CPPVisitor extends ASTQueries {
ICPPFunctionScope functionScope = (ICPPFunctionScope) getContainingScope(gotoStatement.getName());
IASTName name = gotoStatement.getName();
IBinding binding;
- try {
- binding = functionScope.getBinding(name, false);
- if (binding == null || !(binding instanceof ILabel)) {
- binding = new CPPLabel(name);
- ASTInternal.addName(functionScope, name);
- }
- } catch (DOMException e) {
- binding = e.getProblem();
- }
+ binding = functionScope.getBinding(name, false);
+ if (binding == null || !(binding instanceof ILabel)) {
+ binding = new CPPLabel(name);
+ ASTInternal.addName(functionScope, name);
+ }
return binding;
}
@@ -311,17 +313,13 @@ public class CPPVisitor extends ASTQueries {
ICPPFunctionScope functionScope = (ICPPFunctionScope) getContainingScope(labelStatement.getName());
IASTName name = labelStatement.getName();
IBinding binding;
- try {
- binding = functionScope.getBinding(name, false);
- if (binding == null || !(binding instanceof ILabel)) {
- binding = new CPPLabel(name);
- ASTInternal.addName(functionScope, name);
- } else {
- ((CPPLabel) binding).setLabelStatement(name);
- }
- } catch (DOMException e) {
- binding = e.getProblem();
- }
+ binding = functionScope.getBinding(name, false);
+ if (binding == null || !(binding instanceof ILabel)) {
+ binding = new CPPLabel(name);
+ ASTInternal.addName(functionScope, name);
+ } else {
+ ((CPPLabel) binding).setLabelStatement(name);
+ }
return binding;
}
@@ -329,45 +327,37 @@ public class CPPVisitor extends ASTQueries {
private static IBinding createBinding(IASTEnumerator enumerator) {
ICPPScope scope = (ICPPScope) getContainingScope(enumerator);
IBinding enumtor;
- try {
- enumtor = scope.getBinding(enumerator.getName(), false);
- if (enumtor == null || !(enumtor instanceof IEnumerator)) {
- enumtor = new CPPEnumerator(enumerator.getName());
- }
- } catch (DOMException e) {
- enumtor = e.getProblem();
- }
+ enumtor = scope.getBinding(enumerator.getName(), false);
+ if (enumtor == null || !(enumtor instanceof IEnumerator)) {
+ enumtor = new CPPEnumerator(enumerator.getName());
+ }
return enumtor;
}
private static IBinding createBinding(ICPPASTEnumerationSpecifier specifier) {
ICPPScope scope = (ICPPScope) getContainingScope(specifier);
- try {
- final IASTName name = specifier.getName();
- IType fixedType= createEnumBaseType(specifier);
- IBinding binding = scope.getBinding(name, false);
- if (binding instanceof CPPEnumeration) {
- CPPEnumeration e= (CPPEnumeration) binding;
- if (e.isScoped() == specifier.isScoped()) {
- IType ft2= e.getFixedType();
- if (fixedType == ft2 || (fixedType != null && fixedType.isSameType(ft2))) {
- if (specifier.isOpaque()) {
- e.addDeclaration(specifier);
- } else if (e.getDefinition() == null) {
- e.addDefinition(specifier);
- } else {
- return new ProblemBinding(name, IProblemBinding.SEMANTIC_INVALID_REDEFINITION);
- }
- return e;
+ final IASTName name = specifier.getName();
+ IType fixedType= createEnumBaseType(specifier);
+ IBinding binding = scope.getBinding(name, false);
+ if (binding instanceof CPPEnumeration) {
+ CPPEnumeration e= (CPPEnumeration) binding;
+ if (e.isScoped() == specifier.isScoped()) {
+ IType ft2= e.getFixedType();
+ if (fixedType == ft2 || (fixedType != null && fixedType.isSameType(ft2))) {
+ if (specifier.isOpaque()) {
+ e.addDeclaration(specifier);
+ } else if (e.getDefinition() == null) {
+ e.addDefinition(specifier);
+ } else {
+ return new ProblemBinding(name, IProblemBinding.SEMANTIC_INVALID_REDEFINITION);
}
+ return e;
}
- return new ProblemBinding(name, IProblemBinding.SEMANTIC_INVALID_REDECLARATION);
- }
- return new CPPEnumeration(specifier, fixedType);
- } catch (DOMException e) {
- return e.getProblem();
- }
+ }
+ return new ProblemBinding(name, IProblemBinding.SEMANTIC_INVALID_REDECLARATION);
+ }
+ return new CPPEnumeration(specifier, fixedType);
}
private static IType createEnumBaseType(ICPPASTEnumerationSpecifier specifier) {
@@ -517,15 +507,11 @@ public class CPPVisitor extends ASTQueries {
ICPPASTNamespaceDefinition namespaceDef = (ICPPASTNamespaceDefinition) declaration;
ICPPScope scope = (ICPPScope) getContainingScope(namespaceDef);
IBinding binding;
- try {
- binding = scope.getBinding(namespaceDef.getName(), false);
- if (!(binding instanceof ICPPInternalBinding) || binding instanceof IProblemBinding
- || !(binding instanceof ICPPNamespace)) {
- binding = new CPPNamespace(namespaceDef);
- }
- } catch (DOMException e) {
- binding = e.getProblem();
- }
+ binding = scope.getBinding(namespaceDef.getName(), false);
+ if (!(binding instanceof ICPPInternalBinding) || binding instanceof IProblemBinding
+ || !(binding instanceof ICPPNamespace)) {
+ binding = new CPPNamespace(namespaceDef);
+ }
return binding;
} else if (declaration instanceof ICPPASTUsingDirective) {
return CPPSemantics.resolveBinding(((ICPPASTUsingDirective) declaration).getQualifiedName());
@@ -533,24 +519,20 @@ public class CPPVisitor extends ASTQueries {
ICPPASTNamespaceAlias alias = (ICPPASTNamespaceAlias) declaration;
ICPPScope scope = (ICPPScope) getContainingScope(declaration);
IBinding binding;
- try {
- binding = scope.getBinding(alias.getAlias(), false);
- if (!(binding instanceof ICPPInternalBinding)) {
- IBinding namespace = alias.getMappingName().resolveBinding();
- if (namespace instanceof IProblemBinding) {
- IProblemBinding problem = (IProblemBinding) namespace;
- namespace = new CPPNamespace.CPPNamespaceProblem(problem.getASTNode(),
- problem.getID(), alias.getMappingName().toCharArray());
- }
- if (namespace instanceof ICPPNamespace) {
- binding = new CPPNamespaceAlias(alias.getAlias(), (ICPPNamespace) namespace);
- } else {
- binding = new ProblemBinding(alias.getAlias(), IProblemBinding.SEMANTIC_NAME_NOT_FOUND);
- }
- }
- } catch (DOMException e) {
- binding = e.getProblem();
- }
+ binding = scope.getBinding(alias.getAlias(), false);
+ if (!(binding instanceof ICPPInternalBinding)) {
+ IBinding namespace = alias.getMappingName().resolveBinding();
+ if (namespace instanceof IProblemBinding) {
+ IProblemBinding problem = (IProblemBinding) namespace;
+ namespace = new CPPNamespace.CPPNamespaceProblem(problem.getASTNode(),
+ problem.getID(), alias.getMappingName().toCharArray());
+ }
+ if (namespace instanceof ICPPNamespace) {
+ binding = new CPPNamespaceAlias(alias.getAlias(), (ICPPNamespace) namespace);
+ } else {
+ binding = new ProblemBinding(alias.getAlias(), IProblemBinding.SEMANTIC_NAME_NOT_FOUND);
+ }
+ }
return binding;
}
@@ -637,31 +619,27 @@ public class CPPVisitor extends ASTQueries {
final boolean template= tmplDecl != null;
boolean isFriendDecl= false;
ICPPScope scope = (ICPPScope) getContainingNonTemplateScope(name);
- try {
- if (scope instanceof ICPPClassScope) {
- if (parent instanceof IASTSimpleDeclaration) {
- ICPPASTDeclSpecifier declSpec = (ICPPASTDeclSpecifier) ((IASTSimpleDeclaration) parent).getDeclSpecifier();
- isFriendDecl= declSpec.isFriend();
- } else if (parent instanceof IASTFunctionDefinition) {
- ICPPASTDeclSpecifier declSpec = (ICPPASTDeclSpecifier) ((IASTFunctionDefinition) parent).getDeclSpecifier();
- isFriendDecl= declSpec.isFriend();
- }
- if (isFriendDecl) {
- try {
- while (scope.getKind() == EScopeKind.eClassType) {
- scope = (ICPPScope) getParentScope(scope, name.getTranslationUnit());
- }
- } catch (DOMException e1) {
+ if (scope instanceof ICPPClassScope) {
+ if (parent instanceof IASTSimpleDeclaration) {
+ ICPPASTDeclSpecifier declSpec = (ICPPASTDeclSpecifier) ((IASTSimpleDeclaration) parent).getDeclSpecifier();
+ isFriendDecl= declSpec.isFriend();
+ } else if (parent instanceof IASTFunctionDefinition) {
+ ICPPASTDeclSpecifier declSpec = (ICPPASTDeclSpecifier) ((IASTFunctionDefinition) parent).getDeclSpecifier();
+ isFriendDecl= declSpec.isFriend();
+ }
+ if (isFriendDecl) {
+ try {
+ while (scope.getKind() == EScopeKind.eClassType) {
+ scope = (ICPPScope) getParentScope(scope, name.getTranslationUnit());
}
+ } catch (DOMException e1) {
}
}
- boolean forceResolve= isFriendDecl && name instanceof ICPPASTTemplateId;
- if (name.getLookupKey().length != 0 && scope != null) {
- binding = scope.getBinding(name, forceResolve);
- }
- } catch (DOMException e) {
- return e.getProblem();
- }
+ }
+ boolean forceResolve= isFriendDecl && name instanceof ICPPASTTemplateId;
+ if (name.getLookupKey().length != 0 && scope != null) {
+ binding = scope.getBinding(name, forceResolve);
+ }
boolean isFunction= false;
if (parent instanceof ICPPASTFunctionDefinition) {
@@ -769,16 +747,12 @@ public class CPPVisitor extends ASTQueries {
if (containingScope == null || !(containingScope instanceof ICPPClassScope))
return false;
- ICPPASTCompositeTypeSpecifier clsTypeSpec;
- try {
- IASTNode node = ASTInternal.getPhysicalNodeOfScope(containingScope);
- if (node instanceof ICPPASTCompositeTypeSpecifier)
- clsTypeSpec = (ICPPASTCompositeTypeSpecifier) node;
- else
- return false;
- } catch (DOMException e) {
- return false;
- }
+ IASTNode node = ASTInternal.getPhysicalNodeOfScope(containingScope);
+ if (!(node instanceof ICPPASTCompositeTypeSpecifier)) {
+ return false;
+ }
+
+ ICPPASTCompositeTypeSpecifier clsTypeSpec = (ICPPASTCompositeTypeSpecifier) node;
IASTName clsName = clsTypeSpec.getName();
if (clsName instanceof ICPPASTQualifiedName) {
IASTName[] names = ((ICPPASTQualifiedName) clsName).getNames();
@@ -1898,11 +1872,7 @@ public class CPPVisitor extends ASTQueries {
if (name != null) {
IBinding binding = name.resolvePreBinding();
if (binding instanceof ICPPConstructor) {
- try {
- type= ((ICPPConstructor) binding).getClassOwner();
- } catch (DOMException e) {
- type = e.getProblem();
- }
+ type= ((ICPPConstructor) binding).getClassOwner();
} else if (binding instanceof IType) {
type = (IType) binding;
} else if (binding instanceof ICPPTemplateNonTypeParameter) {
@@ -2053,16 +2023,13 @@ public class CPPVisitor extends ASTQueries {
public static IType getPointerDiffType(final IASTBinaryExpression binary) {
CPPBasicType basicType;
IScope scope = getContainingScope(binary);
- try {
- IBinding[] bs= CPPSemantics.findBindings(scope, PTRDIFF_T, false, binary);
- if (bs.length > 0) {
- for (IBinding b : bs) {
- if (b instanceof IType && CPPSemantics.declaredBefore(b, binary, false)) {
- return (IType) b;
- }
+ IBinding[] bs= CPPSemantics.findBindings(scope, PTRDIFF_T, false, binary);
+ if (bs.length > 0) {
+ for (IBinding b : bs) {
+ if (b instanceof IType && CPPSemantics.declaredBefore(b, binary, false)) {
+ return (IType) b;
}
}
- } catch (DOMException e) {
}
basicType= new CPPBasicType(Kind.eInt, 0);
basicType.setFromExpression(binary);
@@ -2070,49 +2037,40 @@ public class CPPVisitor extends ASTQueries {
}
public static IType get_type_info(IASTExpression expression) {
- try {
- IBinding[] std= expression.getTranslationUnit().getScope().find(STD);
- for (IBinding binding : std) {
- if (binding instanceof ICPPNamespace) {
- IBinding[] typeInfo= ((ICPPNamespace) binding).getNamespaceScope().find(TYPE_INFO);
- for (IBinding t : typeInfo) {
- if (t instanceof ICPPClassType) {
- return (ICPPClassType) t;
- }
+ IBinding[] std= expression.getTranslationUnit().getScope().find(STD);
+ for (IBinding binding : std) {
+ if (binding instanceof ICPPNamespace) {
+ IBinding[] typeInfo= ((ICPPNamespace) binding).getNamespaceScope().find(TYPE_INFO);
+ for (IBinding t : typeInfo) {
+ if (t instanceof ICPPClassType) {
+ return (ICPPClassType) t;
}
}
}
- } catch (DOMException e) {
}
return new CPPBasicType(Kind.eInt, 0);
}
public static IType get_SIZE_T(IASTNode sizeofExpr) {
IScope scope = getContainingScope(sizeofExpr);
- try {
- IBinding[] bs = CPPSemantics.findBindings(scope, SIZE_T, false, sizeofExpr);
- if (bs.length > 0 && bs[0] instanceof IType) {
- return (IType) bs[0];
- }
- } catch (DOMException e) {
+ IBinding[] bs = CPPSemantics.findBindings(scope, SIZE_T, false, sizeofExpr);
+ if (bs.length > 0 && bs[0] instanceof IType) {
+ return (IType) bs[0];
}
return new CPPBasicType(Kind.eInt, IBasicType.IS_LONG | IBasicType.IS_UNSIGNED);
}
public static ICPPClassTemplate get_initializer_list(IASTNode node) {
- try {
- IBinding[] std= node.getTranslationUnit().getScope().find(STD);
- for (IBinding binding : std) {
- if (binding instanceof ICPPNamespace) {
- IBinding[] initializer_list= ((ICPPNamespace) binding).getNamespaceScope().find(INITIALIZER_LIST);
- for (IBinding t : initializer_list) {
- if (t instanceof ICPPClassTemplate) {
- return (ICPPClassTemplate) t;
- }
+ IBinding[] std= node.getTranslationUnit().getScope().find(STD);
+ for (IBinding binding : std) {
+ if (binding instanceof ICPPNamespace) {
+ IBinding[] initializer_list= ((ICPPNamespace) binding).getNamespaceScope().find(INITIALIZER_LIST);
+ for (IBinding t : initializer_list) {
+ if (t instanceof ICPPClassTemplate) {
+ return (ICPPClassTemplate) t;
}
}
}
- } catch (DOMException e) {
}
return null;
}
@@ -2184,25 +2142,22 @@ public class CPPVisitor extends ASTQueries {
public static String[] getQualifiedName(IBinding binding) {
String[] ns = null;
- try {
- for (IBinding owner= binding.getOwner(); owner != null; owner= owner.getOwner()) {
- if (owner instanceof ICPPEnumeration && !((ICPPEnumeration) owner).isScoped()) {
- continue;
- }
- String n= owner.getName();
- if (n == null)
- break;
- if (owner instanceof ICPPFunction)
- break;
- if (owner instanceof ICPPNamespace && n.length() == 0) {
- // TODO(sprigogin): Do not ignore anonymous namespaces.
- continue;
- }
-
- ns = (String[]) ArrayUtil.append(String.class, ns, n);
- }
- } catch (DOMException e) {
- }
+ for (IBinding owner= binding.getOwner(); owner != null; owner= owner.getOwner()) {
+ if (owner instanceof ICPPEnumeration && !((ICPPEnumeration) owner).isScoped()) {
+ continue;
+ }
+ String n= owner.getName();
+ if (n == null)
+ break;
+ if (owner instanceof ICPPFunction)
+ break;
+ if (owner instanceof ICPPNamespace && n.length() == 0) {
+ // TODO(sprigogin): Do not ignore anonymous namespaces.
+ continue;
+ }
+
+ ns = (String[]) ArrayUtil.append(String.class, ns, n);
+ }
ns = (String[]) ArrayUtil.trim(String.class, ns);
String[] result = new String[ns.length + 1];
for (int i = ns.length - 1; i >= 0; i--) {
@@ -2214,20 +2169,17 @@ public class CPPVisitor extends ASTQueries {
public static char[][] getQualifiedNameCharArray(IBinding binding) {
char[][] ns = null;
- try {
- for (IBinding owner= binding.getOwner(); owner != null; owner= owner.getOwner()) {
- char[] n= owner.getNameCharArray();
- if (n == null)
- break;
- if (owner instanceof ICPPFunction)
- break;
- if (owner instanceof ICPPNamespace && n.length == 0)
- continue;
-
- ns = (char[][]) ArrayUtil.append(n.getClass(), ns, n);
- }
- } catch (DOMException e) {
- }
+ for (IBinding owner= binding.getOwner(); owner != null; owner= owner.getOwner()) {
+ char[] n= owner.getNameCharArray();
+ if (n == null)
+ break;
+ if (owner instanceof ICPPFunction)
+ break;
+ if (owner instanceof ICPPNamespace && n.length == 0)
+ continue;
+
+ ns = (char[][]) ArrayUtil.append(n.getClass(), ns, n);
+ }
final char[] bname = binding.getNameCharArray();
ns = (char[][]) ArrayUtil.trim(bname.getClass(), ns);
char[][] result = new char[ns.length + 1][];
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/SemanticUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/SemanticUtil.java
index ec1cf3da69..74fd02b0e8 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/SemanticUtil.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/SemanticUtil.java
@@ -15,7 +15,6 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
import static org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CVQualifier.*;
-import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTNode;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
@@ -495,32 +494,28 @@ public class SemanticUtil {
* Returns <code>true</code> if two bindings have the same owner.
*/
public static boolean isSameOwner(IBinding owner1, IBinding owner2) {
- try {
- // Ignore anonymous namespaces
- while (owner1 instanceof ICPPNamespace && owner1.getNameCharArray().length == 0)
- owner1= owner1.getOwner();
- // Ignore anonymous namespaces
- while (owner2 instanceof ICPPNamespace && owner2.getNameCharArray().length == 0)
- owner2= owner2.getOwner();
-
- if (owner1 == null)
- return owner2 == null;
- if (owner2 == null)
- return false;
-
- if (owner1 instanceof IType) {
- if (owner2 instanceof IType) {
- return ((IType) owner1).isSameType((IType) owner2);
- }
- } else if (owner1 instanceof ICPPNamespace) {
- if (owner2 instanceof ICPPNamespace) {
- if (!CharArrayUtils.equals(owner1.getNameCharArray(), owner2.getNameCharArray()))
- return false;
- return isSameOwner(owner1.getOwner(), owner2.getOwner());
- }
+ // Ignore anonymous namespaces
+ while (owner1 instanceof ICPPNamespace && owner1.getNameCharArray().length == 0)
+ owner1= owner1.getOwner();
+ // Ignore anonymous namespaces
+ while (owner2 instanceof ICPPNamespace && owner2.getNameCharArray().length == 0)
+ owner2= owner2.getOwner();
+
+ if (owner1 == null)
+ return owner2 == null;
+ if (owner2 == null)
+ return false;
+
+ if (owner1 instanceof IType) {
+ if (owner2 instanceof IType) {
+ return ((IType) owner1).isSameType((IType) owner2);
+ }
+ } else if (owner1 instanceof ICPPNamespace) {
+ if (owner2 instanceof ICPPNamespace) {
+ if (!CharArrayUtils.equals(owner1.getNameCharArray(), owner2.getNameCharArray()))
+ return false;
+ return isSameOwner(owner1.getOwner(), owner2.getOwner());
}
- } catch (DOMException e) {
- CCorePlugin.log(e);
}
return false;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java
index 11276d4cc4..02d6abf38b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java
@@ -28,7 +28,6 @@ import java.util.regex.Pattern;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.IName;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
@@ -650,23 +649,18 @@ public class CIndex implements IIndex {
}
IIndexFragmentBinding[][] preresult = new IIndexFragmentBinding[fPrimaryFragmentCount][];
- try {
- for (int i = 0; i < fPrimaryFragmentCount; i++) {
- IIndexScope[] raw = fFragments[i].getInlineNamespaces();
- IIndexFragmentBinding[] arr = preresult[i] = new IIndexFragmentBinding[raw.length];
- for (int j=0; j<raw.length; j++) {
- arr[j]= (IIndexFragmentBinding) raw[j].getScopeBinding();
- }
- }
- IIndexBinding[] compBinding = getCompositesFactory(ILinkage.CPP_LINKAGE_ID).getCompositeBindings(preresult);
- IIndexScope[] result = new IIndexScope[compBinding.length];
- for(int i=0; i<result.length; i++) {
- result[i]= (IIndexScope) ((ICPPNamespace) compBinding[i]).getNamespaceScope();
- }
- return result;
- } catch (DOMException e) {
- // Index bindings don't throw DOMExceptions.
- return new IIndexScope[0];
+ for (int i = 0; i < fPrimaryFragmentCount; i++) {
+ IIndexScope[] raw = fFragments[i].getInlineNamespaces();
+ IIndexFragmentBinding[] arr = preresult[i] = new IIndexFragmentBinding[raw.length];
+ for (int j=0; j<raw.length; j++) {
+ arr[j]= (IIndexFragmentBinding) raw[j].getScopeBinding();
+ }
+ }
+ IIndexBinding[] compBinding = getCompositesFactory(ILinkage.CPP_LINKAGE_ID).getCompositeBindings(preresult);
+ IIndexScope[] result = new IIndexScope[compBinding.length];
+ for(int i=0; i<result.length; i++) {
+ result[i]= (IIndexScope) ((ICPPNamespace) compBinding[i]).getNamespaceScope();
}
+ return result;
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CPPTypedefClone.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CPPTypedefClone.java
index c69e8a62a9..6e19e14093 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CPPTypedefClone.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CPPTypedefClone.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -51,7 +51,7 @@ public class CPPTypedefClone implements ITypedef, ITypeContainer, IIndexType, IC
return delegate.getScope();
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return delegate.getOwner();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IIndexFragmentBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IIndexFragmentBinding.java
index 0d853632ca..ce4227d702 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IIndexFragmentBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IIndexFragmentBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2010 Wind River Systems, Inc. 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
@@ -13,7 +13,6 @@
package org.eclipse.cdt.internal.core.index;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.core.runtime.CoreException;
@@ -56,7 +55,7 @@ public interface IIndexFragmentBinding extends IIndexBinding {
* {@inheritDoc}
* @since 5.1
*/
- IIndexFragmentBinding getOwner() throws DOMException;
+ IIndexFragmentBinding getOwner();
/**
* Returns a unique id for the binding within the fragment
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeIndexBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeIndexBinding.java
index 14af8c1ac1..2f63d7f1a5 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeIndexBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeIndexBinding.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -13,7 +13,6 @@
package org.eclipse.cdt.internal.core.index.composite;
import org.eclipse.cdt.core.dom.ILinkage;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.index.IIndexFile;
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
@@ -113,7 +112,7 @@ public abstract class CompositeIndexBinding implements IIndexBinding {
return rbinding.hashCode();
}
- public IIndexBinding getOwner() throws DOMException {
+ public IIndexBinding getOwner() {
final IIndexFragmentBinding owner= rbinding.getOwner();
if (owner == null)
return null;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java
index 46361e0166..3fe5f8ba58 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/CompositeScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.index.composite;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
@@ -54,13 +53,10 @@ public abstract class CompositeScope implements IIndexScope {
}
public IIndexName getScopeName() {
- try {
- if(rbinding instanceof IIndexScope)
- return ((IIndexScope) rbinding).getScopeName();
- if(rbinding instanceof ICPPClassType)
- return (IIndexName) ((ICPPClassType) rbinding).getCompositeScope().getScopeName();
- } catch (DOMException e) {
- }
+ if(rbinding instanceof IIndexScope)
+ return ((IIndexScope) rbinding).getScopeName();
+ if(rbinding instanceof ICPPClassType)
+ return (IIndexName) ((ICPPClassType) rbinding).getCompositeScope().getScopeName();
return null;
}
@@ -116,11 +112,11 @@ public abstract class CompositeScope implements IIndexScope {
return IBinding.EMPTY_BINDING_ARRAY;
}
- public final IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
+ public final IBinding getBinding(IASTName name, boolean resolve) {
return getBinding(name, resolve, IIndexFileSet.EMPTY);
}
- public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) throws DOMException {
+ public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) {
return getBindings(name, resolve, prefix, IIndexFileSet.EMPTY);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CCompositesFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CCompositesFactory.java
index 8d7aedc5a0..024188846a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CCompositesFactory.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CCompositesFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.c;
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBasicType;
import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IEnumeration;
@@ -54,13 +52,9 @@ public class CCompositesFactory extends AbstractCompositeFactory {
if(rscope==null)
return null;
if(rscope instanceof ICCompositeTypeScope) {
- try {
- ICCompositeTypeScope cscope = (ICCompositeTypeScope) rscope;
- IIndexFragmentBinding rbinding = (IIndexFragmentBinding) cscope.getCompositeType();
- return (IIndexScope) ((ICompositeType)getCompositeBinding(rbinding)).getCompositeScope();
- } catch(DOMException de) {
- CCorePlugin.log(de);
- }
+ ICCompositeTypeScope cscope = (ICCompositeTypeScope) rscope;
+ IIndexFragmentBinding rbinding = (IIndexFragmentBinding) cscope.getCompositeType();
+ return (IIndexScope) ((ICompositeType)getCompositeBinding(rbinding)).getCompositeScope();
}
throw new CompositingNotImplementedError();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCCompositeScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCCompositeScope.java
index 36e14ae4f4..92c53eb6fe 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCCompositeScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCCompositeScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.c;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -28,7 +27,7 @@ class CompositeCCompositeScope extends CompositeScope implements ICCompositeType
super(cf, rbinding);
}
- public IBinding getBinding(char[] name) throws DOMException {
+ public IBinding getBinding(char[] name) {
fail(); return null;
}
@@ -36,17 +35,17 @@ class CompositeCCompositeScope extends CompositeScope implements ICCompositeType
return (ICompositeType) cf.getCompositeBinding(rbinding);
}
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
IBinding binding = ((ICompositeType)rbinding).getCompositeScope().getBinding(name, resolve, fileSet);
return processUncertainBinding(binding);
}
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
IBinding[] bindings = ((ICompositeType)rbinding).getCompositeScope().getBindings(name, resolve, prefixLookup, fileSet);
return processUncertainBindings(bindings);
}
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
IBinding[] preresult = ((ICompositeType)rbinding).getCompositeScope().find(name);
return processUncertainBindings(preresult);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCField.java
index 08fdea0cab..8ca3878975 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCField.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCField.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.c;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IField;
@@ -22,7 +21,7 @@ class CompositeCField extends CompositeCVariable implements IField {
super(cf, rbinding);
}
- public ICompositeType getCompositeTypeOwner() throws DOMException {
+ public ICompositeType getCompositeTypeOwner() {
IBinding preresult = ((IField)rbinding).getCompositeTypeOwner();
return (ICompositeType) cf.getCompositeBinding((IIndexFragmentBinding)preresult);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCFunction.java
index 266a5fa5c6..ec2e9975bb 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCFunction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -45,27 +45,27 @@ class CompositeCFunction extends CompositeCBinding implements IFunction {
return (IFunctionType) cf.getCompositeType(rtype);
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return ((IFunction)rbinding).isAuto();
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return ((IFunction)rbinding).isExtern();
}
- public boolean isInline() throws DOMException {
+ public boolean isInline() {
return ((IFunction)rbinding).isInline();
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return ((IFunction)rbinding).isRegister();
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return ((IFunction)rbinding).isStatic();
}
- public boolean takesVarArgs() throws DOMException {
+ public boolean takesVarArgs() {
return ((IFunction)rbinding).takesVarArgs();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCParameter.java
index c05b79b2bf..49384c0747 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCParameter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -28,19 +28,19 @@ class CompositeCParameter extends CompositeCBinding implements IParameter {
return cf.getCompositeType(rtype);
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return ((IParameter)rbinding).isAuto();
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return ((IParameter)rbinding).isExtern();
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return ((IParameter)rbinding).isRegister();
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return ((IParameter)rbinding).isStatic();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCStructure.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCStructure.java
index f0c646b30c..e43876a24c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCStructure.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCStructure.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.c;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope;
@@ -25,23 +24,23 @@ class CompositeCStructure extends CompositeCBinding implements ICompositeType, I
super(cf, rbinding);
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
IField preresult = ((ICompositeType)rbinding).findField(name);
return (IField) cf.getCompositeBinding((IIndexFragmentBinding) preresult);
}
- public IScope getCompositeScope() throws DOMException {
+ public IScope getCompositeScope() {
return new CompositeCCompositeScope(cf, rbinding);
}
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
IField[] result = ((ICompositeType)rbinding).getFields();
for(int i=0; i<result.length; i++)
result[i] = (IField) cf.getCompositeBinding((IIndexFragmentBinding)result[i]);
return result;
}
- public int getKey() throws DOMException {
+ public int getKey() {
return ((ICompositeType)rbinding).getKey();
}
@@ -52,7 +51,7 @@ class CompositeCStructure extends CompositeCBinding implements ICompositeType, I
@Override
public Object clone() {fail(); return null;}
- public boolean isAnonymous() throws DOMException {
+ public boolean isAnonymous() {
return ((ICompositeType)rbinding).isAnonymous();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCVariable.java
index 411995cdae..b05e788883 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCVariable.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/c/CompositeCVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -28,19 +28,19 @@ class CompositeCVariable extends CompositeCBinding implements IVariable {
return cf.getCompositeType(rtype);
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return ((IVariable)rbinding).isAuto();
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return ((IVariable)rbinding).isExtern();
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return ((IVariable)rbinding).isRegister();
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return ((IVariable)rbinding).isStatic();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassScope.java
index 1f6332aae9..8b94c78d62 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -11,8 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -40,44 +38,34 @@ class CompositeCPPClassScope extends CompositeScope implements ICPPClassScope {
}
public ICPPMethod[] getImplicitMethods() {
- try {
- ICPPClassScope rscope = (ICPPClassScope) ((ICPPClassType)rbinding).getCompositeScope();
- ICPPMethod[] result = rscope.getImplicitMethods();
- for(int i=0; i<result.length; i++) {
- result[i] = (ICPPMethod) cf.getCompositeBinding((IIndexFragmentBinding)result[i]);
- }
- return result;
- } catch (DOMException de) {
- CCorePlugin.log(de);
+ ICPPClassScope rscope = (ICPPClassScope) ((ICPPClassType)rbinding).getCompositeScope();
+ ICPPMethod[] result = rscope.getImplicitMethods();
+ for(int i=0; i<result.length; i++) {
+ result[i] = (ICPPMethod) cf.getCompositeBinding((IIndexFragmentBinding)result[i]);
}
- return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
+ return result;
}
public ICPPConstructor[] getConstructors() {
- try {
- ICPPClassScope rscope = (ICPPClassScope) ((ICPPClassType)rbinding).getCompositeScope();
- ICPPConstructor[] result = rscope.getConstructors();
- for(int i=0; i<result.length; i++) {
- result[i] = (ICPPConstructor) cf.getCompositeBinding((IIndexFragmentBinding)result[i]);
- }
- return result;
- } catch (DOMException de) {
- CCorePlugin.log(de);
+ ICPPClassScope rscope = (ICPPClassScope) ((ICPPClassType)rbinding).getCompositeScope();
+ ICPPConstructor[] result = rscope.getConstructors();
+ for(int i=0; i<result.length; i++) {
+ result[i] = (ICPPConstructor) cf.getCompositeBinding((IIndexFragmentBinding)result[i]);
}
- return ICPPConstructor.EMPTY_CONSTRUCTOR_ARRAY;
+ return result;
}
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
IBinding binding = ((ICPPClassType)rbinding).getCompositeScope().getBinding(name, resolve, fileSet);
return processUncertainBinding(binding);
}
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
IBinding[] bindings = ((ICPPClassType)rbinding).getCompositeScope().getBindings(name, resolve, prefixLookup, fileSet);
return processUncertainBindings(bindings);
}
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
IBinding[] preresult = ((ICPPClassType)rbinding).getCompositeScope().find(name);
return processUncertainBindings(preresult);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java
index cf1db4e189..ffd39e9dc3 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -11,8 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope;
@@ -44,7 +42,7 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple
}
@Override
- public ICPPClassScope getCompositeScope() throws DOMException {
+ public ICPPClassScope getCompositeScope() {
return (ICPPClassScope) cf.getCompositeScope((IIndexScope) ((ICPPClassType) rbinding).getCompositeScope());
}
@@ -53,12 +51,9 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple
}
public ICPPTemplateParameterMap getTemplateParameterMap() {
- try {
- IBinding owner= getOwner();
- if (owner instanceof ICPPSpecialization) {
- return ((ICPPSpecialization) owner).getTemplateParameterMap();
- }
- } catch (DOMException e) {
+ IBinding owner= getOwner();
+ if (owner instanceof ICPPSpecialization) {
+ return ((ICPPSpecialization) owner).getTemplateParameterMap();
}
return CPPTemplateParameterMap.EMPTY;
}
@@ -72,27 +67,23 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple
specializationMap= (ObjectMap) cached;
} else {
final ObjectMap newMap= new ObjectMap(2);
- try {
- // in any fragment explicit specializations may be defined.
- IIndexFragmentBinding[] frags= cf.findEquivalentBindings(rbinding);
- for (IIndexFragmentBinding fb : frags) {
- if (fb instanceof ICPPClassType) {
- final ICPPClassType[] nested = ((ICPPClassType)fb).getNestedClasses();
- if (nested.length > 0) {
- for (ICPPClassType ct : nested) {
- if (ct instanceof ICPPClassSpecialization &&
- !(ct.getCompositeScope() instanceof ICPPClassSpecializationScope)) {
- ICPPClassSpecialization cspec= (ICPPClassSpecialization) cf.getCompositeBinding((IIndexFragmentBinding) ct);
- newMap.put(cspec.getSpecializedBinding(), cspec);
- }
+ // in any fragment explicit specializations may be defined.
+ IIndexFragmentBinding[] frags= cf.findEquivalentBindings(rbinding);
+ for (IIndexFragmentBinding fb : frags) {
+ if (fb instanceof ICPPClassType) {
+ final ICPPClassType[] nested = ((ICPPClassType)fb).getNestedClasses();
+ if (nested.length > 0) {
+ for (ICPPClassType ct : nested) {
+ if (ct instanceof ICPPClassSpecialization &&
+ !(ct.getCompositeScope() instanceof ICPPClassSpecializationScope)) {
+ ICPPClassSpecialization cspec= (ICPPClassSpecialization) cf.getCompositeBinding((IIndexFragmentBinding) ct);
+ newMap.put(cspec.getSpecializedBinding(), cspec);
}
- if (!newMap.isEmpty())
- break;
}
+ if (!newMap.isEmpty())
+ break;
}
}
- } catch (DOMException e) {
- CCorePlugin.log(e);
}
specializationMap= (ObjectMap) frag.putCachedResult(key, newMap, false);
}
@@ -114,7 +105,7 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple
}
@Override
- public ICPPBase[] getBases() throws DOMException {
+ public ICPPBase[] getBases() {
IScope scope= getCompositeScope();
if (scope instanceof ICPPClassSpecializationScope) {
return ((ICPPClassSpecializationScope) scope).getBases();
@@ -123,7 +114,7 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple
}
@Override
- public ICPPConstructor[] getConstructors() throws DOMException {
+ public ICPPConstructor[] getConstructors() {
IScope scope= getCompositeScope();
if (scope instanceof ICPPClassSpecializationScope) {
return ((ICPPClassSpecializationScope) scope).getConstructors();
@@ -132,7 +123,7 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple
}
@Override
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getDeclaredMethods() {
IScope scope= getCompositeScope();
if (scope instanceof ICPPClassSpecializationScope) {
return ((ICPPClassSpecializationScope) scope).getDeclaredMethods();
@@ -141,7 +132,7 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple
}
@Override
- public ICPPField[] getDeclaredFields() throws DOMException {
+ public ICPPField[] getDeclaredFields() {
IScope scope= getCompositeScope();
if (scope instanceof ICPPClassSpecializationScope) {
return ((ICPPClassSpecializationScope) scope).getDeclaredFields();
@@ -150,7 +141,7 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple
}
@Override
- public IBinding[] getFriends() throws DOMException {
+ public IBinding[] getFriends() {
IScope scope= getCompositeScope();
if (scope instanceof ICPPClassSpecializationScope) {
return ((ICPPClassSpecializationScope) scope).getFriends();
@@ -159,7 +150,7 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple
}
@Override
- public ICPPClassType[] getNestedClasses() throws DOMException {
+ public ICPPClassType[] getNestedClasses() {
IScope scope= getCompositeScope();
if (scope instanceof ICPPClassSpecializationScope) {
return ((ICPPClassSpecializationScope) scope).getNestedClasses();
@@ -168,22 +159,22 @@ public class CompositeCPPClassSpecialization extends CompositeCPPClassType imple
}
@Override
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
return ClassTypeHelper.findField(this, name);
}
@Override
- public ICPPMethod[] getAllDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getAllDeclaredMethods() {
return ClassTypeHelper.getAllDeclaredMethods(this);
}
@Override
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
return ClassTypeHelper.getFields(this);
}
@Override
- public ICPPMethod[] getMethods() throws DOMException {
+ public ICPPMethod[] getMethods() {
return ClassTypeHelper.getMethods(this);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecializationScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecializationScope.java
index 4ea171ea51..ab0b721689 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecializationScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassSpecializationScope.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 Symbian Software Systems and others.
+ * Copyright (c) 2008, 2010 Symbian 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -67,49 +66,48 @@ public class CompositeCPPClassSpecializationScope extends CompositeScope impleme
return fDelegate.getImplicitMethods();
}
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
createDelegate();
return fDelegate.find(name);
}
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings)
- throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings) {
createDelegate();
return fDelegate.getBinding(name, resolve, acceptLocalBindings);
}
public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup,
- IIndexFileSet acceptLocalBindings) throws DOMException {
+ IIndexFileSet acceptLocalBindings) {
createDelegate();
return fDelegate.getBindings(name, resolve, prefixLookup, acceptLocalBindings);
}
- public ICPPConstructor[] getConstructors() throws DOMException {
+ public ICPPConstructor[] getConstructors() {
createDelegate();
return fDelegate.getConstructors();
}
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getDeclaredMethods() {
createDelegate();
return fDelegate.getDeclaredMethods();
}
- public ICPPBase[] getBases() throws DOMException {
+ public ICPPBase[] getBases() {
createDelegate();
return fDelegate.getBases();
}
- public ICPPField[] getDeclaredFields() throws DOMException {
+ public ICPPField[] getDeclaredFields() {
createDelegate();
return fDelegate.getDeclaredFields();
}
- public IBinding[] getFriends() throws DOMException {
+ public IBinding[] getFriends() {
createDelegate();
return fDelegate.getFriends();
}
- public ICPPClassType[] getNestedClasses() throws DOMException {
+ public ICPPClassType[] getNestedClasses() {
createDelegate();
return fDelegate.getNestedClasses();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplatePartialSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplatePartialSpecialization.java
index db1afccec3..dd557c0ead 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplatePartialSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplatePartialSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate;
@@ -31,7 +30,7 @@ public class CompositeCPPClassTemplatePartialSpecialization extends CompositeCPP
super(cf, delegate);
}
- public ICPPClassTemplate getPrimaryClassTemplate() throws DOMException {
+ public ICPPClassTemplate getPrimaryClassTemplate() {
ICPPClassTemplate preresult= ((ICPPClassTemplatePartialSpecialization)rbinding).getPrimaryClassTemplate();
return (ICPPClassTemplate) cf.getCompositeBinding((IIndexFragmentBinding)preresult);
}
@@ -45,12 +44,9 @@ public class CompositeCPPClassTemplatePartialSpecialization extends CompositeCPP
}
public ICPPTemplateParameterMap getTemplateParameterMap() {
- try {
- IBinding owner= getOwner();
- if (owner instanceof ICPPSpecialization) {
- return ((ICPPSpecialization) owner).getTemplateParameterMap();
- }
- } catch (DOMException e) {
+ IBinding owner= getOwner();
+ if (owner instanceof ICPPSpecialization) {
+ return ((ICPPSpecialization) owner).getTemplateParameterMap();
}
return CPPTemplateParameterMap.EMPTY;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplatePartialSpecializationSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplatePartialSpecializationSpecialization.java
index 9021844388..9eaa6def0b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplatePartialSpecializationSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassTemplatePartialSpecializationSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2009, 2010 Wind River Systems, Inc. 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
@@ -52,7 +52,7 @@ public class CompositeCPPClassTemplatePartialSpecializationSpecialization extend
return CompositeInstanceCache.getCache(cf, rbinding).getAllInstances();
}
- public ICPPClassTemplate getPrimaryClassTemplate() throws DOMException {
+ public ICPPClassTemplate getPrimaryClassTemplate() {
return (ICPPClassTemplate) cf.getCompositeBinding((IIndexFragmentBinding) ((ICPPClassTemplatePartialSpecializationSpecialization) rbinding).getPrimaryClassTemplate());
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java
index c551bbe11f..d6a42aecf8 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPClassType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.index.composite.cpp;
import org.eclipse.cdt.core.dom.IName;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IType;
@@ -36,12 +35,12 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
fail(); return null;
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
IField preResult = ((ICPPClassType)rbinding).findField(name);
return (IField) cf.getCompositeBinding((IIndexFragmentBinding)preResult);
}
- public ICPPMethod[] getAllDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getAllDeclaredMethods() {
ICPPMethod[] result = ((ICPPClassType)rbinding).getAllDeclaredMethods();
for(int i=0; i<result.length; i++) {
result[i] = (ICPPMethod) cf.getCompositeBinding((IIndexFragmentBinding)result[i]);
@@ -63,7 +62,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
this.writable= writable;
}
- public IBinding getBaseClass() throws DOMException {
+ public IBinding getBaseClass() {
if(baseClass!=null) {
return baseClass;
} else {
@@ -75,11 +74,11 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
return base.getBaseClassSpecifierName();
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return base.getVisibility();
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return base.isVirtual();
}
@@ -97,7 +96,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
}
}
- public ICPPBase[] getBases() throws DOMException {
+ public ICPPBase[] getBases() {
final ICPPBase[] preresult = ((ICPPClassType)rbinding).getBases();
ICPPBase[] result = new ICPPBase[preresult.length];
for(int i=0; i<preresult.length; i++) {
@@ -106,7 +105,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
return result;
}
- public ICPPConstructor[] getConstructors() throws DOMException {
+ public ICPPConstructor[] getConstructors() {
ICPPConstructor[] result = ((ICPPClassType)rbinding).getConstructors();
for(int i=0; i<result.length; i++) {
result[i] = (ICPPConstructor) cf.getCompositeBinding((IIndexFragmentBinding) result[i]);
@@ -114,7 +113,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
return result;
}
- public ICPPField[] getDeclaredFields() throws DOMException {
+ public ICPPField[] getDeclaredFields() {
ICPPField[] result = ((ICPPClassType)rbinding).getDeclaredFields();
for(int i=0; i<result.length; i++) {
result[i] = (ICPPField) cf.getCompositeBinding((IIndexFragmentBinding)result[i]);
@@ -122,7 +121,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
return result;
}
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getDeclaredMethods() {
ICPPMethod[] result = ((ICPPClassType)rbinding).getDeclaredMethods();
for(int i=0; i<result.length; i++) {
result[i]= (ICPPMethod) cf.getCompositeBinding((IIndexFragmentBinding)result[i]);
@@ -130,7 +129,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
return result;
}
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
IField[] result = ((ICPPClassType)rbinding).getFields();
for(int i=0; i<result.length; i++) {
result[i]= (IField) cf.getCompositeBinding((IIndexFragmentBinding)result[i]);
@@ -138,7 +137,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
return result;
}
- public IBinding[] getFriends() throws DOMException {
+ public IBinding[] getFriends() {
IBinding[] preResult = ((ICPPClassType)rbinding).getFriends();
IBinding[] result = new IBinding[preResult.length];
for(int i=0; i<preResult.length; i++) {
@@ -147,7 +146,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
return result;
}
- public ICPPMethod[] getMethods() throws DOMException {
+ public ICPPMethod[] getMethods() {
ICPPMethod[] result = ((ICPPClassType)rbinding).getMethods();
for(int i=0; i<result.length; i++) {
result[i] = (ICPPMethod) cf.getCompositeBinding((IIndexFragmentBinding) result[i]);
@@ -155,7 +154,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
return result;
}
- public ICPPClassType[] getNestedClasses() throws DOMException {
+ public ICPPClassType[] getNestedClasses() {
ICPPClassType[] result = ((ICPPClassType)rbinding).getNestedClasses();
for(int i=0; i<result.length; i++) {
result[i] = (ICPPClassType) cf.getCompositeBinding((IIndexFragmentBinding) result[i]);
@@ -163,11 +162,11 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
return result;
}
- public ICPPScope getCompositeScope() throws DOMException {
+ public ICPPScope getCompositeScope() {
return new CompositeCPPClassScope(cf, rbinding);
}
- public int getKey() throws DOMException {
+ public int getKey() {
return ((ICPPClassType)rbinding).getKey();
}
@@ -175,7 +174,7 @@ class CompositeCPPClassType extends CompositeCPPBinding implements ICPPClassType
return ((ICPPClassType)rbinding).isSameType(type);
}
- public boolean isAnonymous() throws DOMException {
+ public boolean isAnonymous() {
return ((ICPPClassType)rbinding).isAnonymous();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructor.java
index c6d53f4def..97800218ba 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
@@ -20,7 +19,7 @@ class CompositeCPPConstructor extends CompositeCPPMethod implements ICPPConstruc
super(cf, rbinding);
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return ((ICPPConstructor)rbinding).isExplicit();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorInstance.java
index 4e53e0f64d..3076796d69 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorInstance.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
@@ -19,7 +18,7 @@ public class CompositeCPPConstructorInstance extends CompositeCPPMethodInstance
super(cf, rbinding);
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return ((ICPPConstructor)rbinding).isExplicit();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorSpecialization.java
index 785701443b..b7e07b44ab 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
@@ -21,7 +20,7 @@ CompositeCPPMethodSpecialization implements ICPPConstructor {
super(cf, cons);
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return ((ICPPConstructor)rbinding).isExplicit();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorTemplate.java
index 7d72c84cfa..5822df5228 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorTemplate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
@@ -20,7 +19,7 @@ public class CompositeCPPConstructorTemplate extends CompositeCPPMethodTemplate
super(cf, rbinding);
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return ((ICPPConstructor)rbinding).isExplicit();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorTemplateSpecialization.java
index b3a74d4162..d44b57cac2 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorTemplateSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPConstructorTemplateSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
@@ -24,7 +23,7 @@ public class CompositeCPPConstructorTemplateSpecialization
super(cf, ft);
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return ((ICPPConstructor)rbinding).isExplicit();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumScope.java
index 3413928e38..fcaa5ed4c6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPEnumScope.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -31,17 +30,17 @@ class CompositeCPPEnumScope extends CompositeScope implements ICPPScope {
return EScopeKind.eEnumeration;
}
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
IBinding binding = ((ICPPEnumeration)rbinding).asScope().getBinding(name, resolve, fileSet);
return processUncertainBinding(binding);
}
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
IBinding[] bindings = ((ICPPEnumeration)rbinding).asScope().getBindings(name, resolve, prefixLookup, fileSet);
return processUncertainBindings(bindings);
}
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
IBinding[] preresult = ((ICPPEnumeration)rbinding).asScope().find(name);
return processUncertainBindings(preresult);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java
index 427951f45e..24cf749119 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPField.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.IField;
@@ -24,16 +23,16 @@ class CompositeCPPField extends CompositeCPPVariable implements ICPPField {
super(cf, rbinding);
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPField)rbinding).getClassOwner();
return (ICPPClassType) cf.getCompositeBinding(rowner);
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return ((ICPPField)rbinding).getVisibility();
}
- public ICompositeType getCompositeTypeOwner() throws DOMException {
+ public ICompositeType getCompositeTypeOwner() {
IBinding preresult = ((IField)rbinding).getCompositeTypeOwner();
return (ICompositeType) cf.getCompositeBinding((IIndexFragmentBinding) preresult);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFieldSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFieldSpecialization.java
index 69e9edb3d2..51a206247d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFieldSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFieldSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
@@ -31,12 +30,9 @@ public class CompositeCPPFieldSpecialization extends CompositeCPPField implement
}
public ICPPTemplateParameterMap getTemplateParameterMap() {
- try {
- IBinding owner= getOwner();
- if (owner instanceof ICPPSpecialization) {
- return ((ICPPSpecialization) owner).getTemplateParameterMap();
- }
- } catch (DOMException e) {
+ IBinding owner= getOwner();
+ if (owner instanceof ICPPSpecialization) {
+ return ((ICPPSpecialization) owner).getTemplateParameterMap();
}
return CPPTemplateParameterMap.EMPTY;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java
index 90a8902f15..9c6985e1b7 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunction.java
@@ -27,15 +27,15 @@ class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction {
super(cf, rbinding);
}
- public boolean isExternC() throws DOMException {
+ public boolean isExternC() {
return ((ICPPFunction)rbinding).isExternC();
}
- public boolean isInline() throws DOMException {
+ public boolean isInline() {
return ((ICPPFunction)rbinding).isInline();
}
- public boolean isMutable() throws DOMException {
+ public boolean isMutable() {
return ((ICPPFunction)rbinding).isMutable();
}
@@ -60,23 +60,23 @@ class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction {
return ((ICPPFunction)rbinding).isDeleted();
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return ((ICPPFunction)rbinding).isAuto();
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return ((ICPPFunction)rbinding).isExtern();
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return ((ICPPFunction)rbinding).isRegister();
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return ((ICPPFunction)rbinding).isStatic();
}
- public boolean takesVarArgs() throws DOMException {
+ public boolean takesVarArgs() {
return ((ICPPFunction)rbinding).takesVarArgs();
}
@@ -104,7 +104,7 @@ class CompositeCPPFunction extends CompositeCPPBinding implements ICPPFunction {
return result.toString();
}
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
IType[] es= ((ICPPFunction)rbinding).getExceptionSpecification();
if (es == null || es.length == 0)
return es;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionSpecialization.java
index 6697d39bf7..5eebba2215 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPFunctionSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -33,12 +33,9 @@ public class CompositeCPPFunctionSpecialization extends CompositeCPPFunction imp
}
public ICPPTemplateParameterMap getTemplateParameterMap() {
- try {
- IBinding owner= getOwner();
- if (owner instanceof ICPPSpecialization) {
- return ((ICPPSpecialization) owner).getTemplateParameterMap();
- }
- } catch (DOMException e) {
+ IBinding owner= getOwner();
+ if (owner instanceof ICPPSpecialization) {
+ return ((ICPPSpecialization) owner).getTemplateParameterMap();
}
return CPPTemplateParameterMap.EMPTY;
}
@@ -55,7 +52,7 @@ public class CompositeCPPFunctionSpecialization extends CompositeCPPFunction imp
}
@Override
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
IType[] es= ((ICPPFunction)rbinding).getExceptionSpecification();
if (es == null || es.length == 0)
return es;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java
index 891ad03912..1ee3be9c68 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethod.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
@@ -31,20 +30,20 @@ class CompositeCPPMethod extends CompositeCPPFunction implements ICPPMethod {
return ((ICPPMethod)rbinding).isImplicit();
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return ((ICPPMethod)rbinding).isVirtual();
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod)rbinding).getClassOwner();
return (ICPPClassType) cf.getCompositeBinding(rowner);
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return ((ICPPMethod)rbinding).getVisibility();
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return ((ICPPMethod)rbinding).isPureVirtual();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodInstance.java
index f2cd93bb5e..38f093130f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodInstance.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
@@ -30,20 +29,20 @@ public class CompositeCPPMethodInstance extends CompositeCPPFunctionInstance imp
return ((ICPPMethod)rbinding).isImplicit();
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return ((ICPPMethod)rbinding).isDestructor();
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod)rbinding).getClassOwner();
return (ICPPClassType) cf.getCompositeBinding(rowner);
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return ((ICPPMethod)rbinding).getVisibility();
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return ((ICPPMethod)rbinding).isPureVirtual();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodSpecialization.java
index cd99aec13a..22805ab352 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
@@ -31,20 +30,20 @@ implements ICPPMethod {
return ((ICPPMethod)rbinding).isImplicit();
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return ((ICPPMethod)rbinding).isVirtual();
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod)rbinding).getClassOwner();
return (ICPPClassType) cf.getCompositeBinding(rowner);
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return ((ICPPMethod)rbinding).getVisibility();
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return ((ICPPMethod)rbinding).isPureVirtual();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplate.java
index 94f4652c90..9341e51047 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
@@ -30,21 +29,21 @@ public class CompositeCPPMethodTemplate extends CompositeCPPFunctionTemplate imp
return ((ICPPMethod)rbinding).isImplicit();
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return ((ICPPMethod)rbinding).isVirtual();
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod)rbinding).getClassOwner();
return (ICPPClassType) cf.getCompositeBinding(rowner);
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return ((ICPPMethod)rbinding).getVisibility();
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return ((ICPPMethod)rbinding).isPureVirtual();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplateSpecialization.java
index 9297bfcfbb..999bfc871d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplateSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPMethodTemplateSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
@@ -34,20 +33,20 @@ public class CompositeCPPMethodTemplateSpecialization
return ((ICPPMethod)rbinding).isImplicit();
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return ((ICPPMethod)rbinding).isVirtual();
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
IIndexFragmentBinding rowner = (IIndexFragmentBinding) ((ICPPMethod)rbinding).getClassOwner();
return (ICPPClassType) cf.getCompositeBinding(rowner);
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return ((ICPPMethod)rbinding).getVisibility();
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return ((ICPPMethod)rbinding).isPureVirtual();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java
index f3e575e0e8..f6ea8d202e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespace.java
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespace;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
@@ -25,7 +24,7 @@ class CompositeCPPNamespace extends CompositeCPPBinding implements ICPPNamespace
this.namespaces = namespaces;
}
- public IBinding[] getMemberBindings() throws DOMException {
+ public IBinding[] getMemberBindings() {
IIndexFragmentBinding[][] memberBindings = new IIndexFragmentBinding[namespaces.length][];
for(int i=0; i<namespaces.length; i++) {
IBinding[] bindings = namespaces[i].getMemberBindings();
@@ -35,7 +34,7 @@ class CompositeCPPNamespace extends CompositeCPPBinding implements ICPPNamespace
return cf.getCompositeBindings(memberBindings);
}
- public ICPPNamespaceScope getNamespaceScope() throws DOMException {
+ public ICPPNamespaceScope getNamespaceScope() {
return new CompositeCPPNamespaceScope(cf, namespaces);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceAlias.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceAlias.java
index a0914dd9db..6da03fa2de 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceAlias.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceAlias.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceAlias;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
@@ -23,7 +22,7 @@ class CompositeCPPNamespaceAlias extends CompositeCPPBinding implements ICPPName
super(cf, alias);
}
- public IBinding[] getMemberBindings() throws DOMException {
+ public IBinding[] getMemberBindings() {
IBinding[] result= ((ICPPNamespaceAlias)rbinding).getMemberBindings();
for(int i=0; i<result.length; i++) {
result[i]= cf.getCompositeBinding((IIndexFragmentBinding)result[i]);
@@ -31,7 +30,7 @@ class CompositeCPPNamespaceAlias extends CompositeCPPBinding implements ICPPName
return result;
}
- public ICPPNamespaceScope getNamespaceScope() throws DOMException {
+ public ICPPNamespaceScope getNamespaceScope() {
return (ICPPNamespaceScope) cf.getCompositeScope((IIndexScope) ((ICPPNamespaceAlias)rbinding).getNamespaceScope());
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceScope.java
index b0b400f80c..2129215d70 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPNamespaceScope.java
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -46,8 +45,7 @@ class CompositeCPPNamespaceScope extends CompositeScope implements ICPPNamespace
return new ICPPUsingDirective[0]; // same behavior as PDOMCPPNamespace
}
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet)
- throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
IBinding preresult = null;
for(int i=0; preresult==null && i<namespaces.length; i++) {
preresult = namespaces[i].getNamespaceScope().getBinding(name, resolve, fileSet);
@@ -55,8 +53,7 @@ class CompositeCPPNamespaceScope extends CompositeScope implements ICPPNamespace
return processUncertainBinding(preresult);
}
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet)
- throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
IIndexFragmentBinding[][] preresult = new IIndexFragmentBinding[namespaces.length][];
for(int i=0; i<namespaces.length; i++) {
IBinding[] raw = namespaces[i].getNamespaceScope().getBindings(name, resolve, prefixLookup, fileSet);
@@ -66,7 +63,7 @@ class CompositeCPPNamespaceScope extends CompositeScope implements ICPPNamespace
return cf.getCompositeBindings(preresult);
}
- final public IBinding[] find(String name) throws DOMException {
+ final public IBinding[] find(String name) {
IIndexFragmentBinding[][] preresult = new IIndexFragmentBinding[namespaces.length][];
for(int i=0; i<namespaces.length; i++) {
IBinding[] raw = namespaces[i].getNamespaceScope().find(name);
@@ -98,23 +95,18 @@ class CompositeCPPNamespaceScope extends CompositeScope implements ICPPNamespace
*/
public ICPPNamespaceScope[] getInlineNamespaces() {
IIndexFragmentBinding[][] preresult = new IIndexFragmentBinding[namespaces.length][];
- try {
- for(int i=0; i<namespaces.length; i++) {
- ICPPNamespaceScope[] raw = namespaces[i].getNamespaceScope().getInlineNamespaces();
- IIndexFragmentBinding[] arr = preresult[i] = new IIndexFragmentBinding[raw.length];
- for (int j=0; j<raw.length; j++) {
- arr[j]= (IIndexFragmentBinding) ((IIndexScope) raw[j]).getScopeBinding();
- }
- }
- IIndexBinding[] compBinding = cf.getCompositeBindings(preresult);
- ICPPNamespaceScope[] result = new ICPPNamespaceScope[compBinding.length];
- for(int i=0; i<result.length; i++) {
- result[i]= ((ICPPNamespace) compBinding[i]).getNamespaceScope();
+ for(int i=0; i<namespaces.length; i++) {
+ ICPPNamespaceScope[] raw = namespaces[i].getNamespaceScope().getInlineNamespaces();
+ IIndexFragmentBinding[] arr = preresult[i] = new IIndexFragmentBinding[raw.length];
+ for (int j=0; j<raw.length; j++) {
+ arr[j]= (IIndexFragmentBinding) ((IIndexScope) raw[j]).getScopeBinding();
}
- return result;
- } catch (DOMException e) {
- // Index bindings don't throw DOMExceptions.
- return new ICPPNamespaceScope[0];
}
+ IIndexBinding[] compBinding = cf.getCompositeBindings(preresult);
+ ICPPNamespaceScope[] result = new ICPPNamespaceScope[compBinding.length];
+ for(int i=0; i<result.length; i++) {
+ result[i]= ((ICPPNamespace) compBinding[i]).getNamespaceScope();
+ }
+ return result;
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameterSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameterSpecialization.java
index 2dc82a9e19..a202fec059 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameterSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPParameterSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameterMap;
@@ -31,12 +30,9 @@ public class CompositeCPPParameterSpecialization extends CompositeCPPParameter i
}
public ICPPTemplateParameterMap getTemplateParameterMap() {
- try {
- IBinding owner= getOwner();
- if (owner instanceof ICPPSpecialization) {
- return ((ICPPSpecialization) owner).getTemplateParameterMap();
- }
- } catch (DOMException e) {
+ IBinding owner= getOwner();
+ if (owner instanceof ICPPSpecialization) {
+ return ((ICPPSpecialization) owner).getTemplateParameterMap();
}
return CPPTemplateParameterMap.EMPTY;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedefSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedefSpecialization.java
index f34add58ce..488583d50d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedefSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPTypedefSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
@@ -30,12 +29,9 @@ class CompositeCPPTypedefSpecialization extends CompositeCPPTypedef implements I
}
public ICPPTemplateParameterMap getTemplateParameterMap() {
- try {
- IBinding owner= getOwner();
- if (owner instanceof ICPPSpecialization) {
- return ((ICPPSpecialization) owner).getTemplateParameterMap();
- }
- } catch (DOMException e) {
+ IBinding owner= getOwner();
+ if (owner instanceof ICPPSpecialization) {
+ return ((ICPPSpecialization) owner).getTemplateParameterMap();
}
return CPPTemplateParameterMap.EMPTY;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUnknownClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUnknownClassType.java
index 06673b1d8c..d785696614 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUnknownClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPUnknownClassType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Google, Inc and others.
+ * Copyright (c) 2008, 2010 Google, Inc 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope;
@@ -35,7 +34,7 @@ class CompositeCPPUnknownClassType extends CompositeCPPUnknownBinding implements
super(cf, rbinding);
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
IField preResult = ((ICPPClassType) rbinding).findField(name);
return (IField) cf.getCompositeBinding((IIndexFragmentBinding)preResult);
}
@@ -96,7 +95,7 @@ class CompositeCPPUnknownClassType extends CompositeCPPUnknownBinding implements
return IBinding.EMPTY_BINDING_ARRAY;
}
- public ICPPClassType[] getNestedClasses() throws DOMException {
+ public ICPPClassType[] getNestedClasses() {
ICPPClassType[] result = ((ICPPClassType) rbinding).getNestedClasses();
for (int i = 0; i < result.length; i++) {
result[i] = (ICPPClassType) cf.getCompositeBinding((IIndexFragmentBinding) result[i]);
@@ -104,11 +103,11 @@ class CompositeCPPUnknownClassType extends CompositeCPPUnknownBinding implements
return result;
}
- public IScope getCompositeScope() throws DOMException {
+ public IScope getCompositeScope() {
return new CompositeCPPClassScope(cf, rbinding);
}
- public int getKey() throws DOMException {
+ public int getKey() {
return ((ICPPClassType) rbinding).getKey();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java
index f4fd53591d..4c368973a2 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/composite/cpp/CompositeCPPVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2010 Symbian 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
@@ -24,11 +24,11 @@ class CompositeCPPVariable extends CompositeCPPBinding implements ICPPVariable {
super(cf, delegate);
}
- public boolean isMutable() throws DOMException {
+ public boolean isMutable() {
return ((ICPPVariable)rbinding).isMutable();
}
- public boolean isExternC() throws DOMException {
+ public boolean isExternC() {
return ((ICPPVariable)rbinding).isExternC();
}
@@ -37,19 +37,19 @@ class CompositeCPPVariable extends CompositeCPPBinding implements ICPPVariable {
return cf.getCompositeType(rtype);
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return ((ICPPVariable)rbinding).isAuto();
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return ((ICPPVariable)rbinding).isExtern();
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return ((ICPPVariable)rbinding).isRegister();
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return ((ICPPVariable)rbinding).isStatic();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.java
index 55d87981c2..0bf82acef9 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.java
@@ -1,22 +1,20 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2010 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Rational Software - Initial API and implementation
+ * Andrew Niefer (IBM Corporation) - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.parser;
-import com.ibm.icu.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
-/**
- * @author aniefer
- */
+import com.ibm.icu.text.MessageFormat;
+
public class ParserMessages {
private static final String BUNDLE_NAME = ParserMessages.class.getName();
private static ResourceBundle resourceBundle;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java
index c28a028d1b..bad20c7d79 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java
@@ -33,7 +33,6 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.IPDOMNode;
import org.eclipse.cdt.core.dom.IPDOMVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorStatement;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -1295,39 +1294,36 @@ public class PDOM extends PlatformObject implements IPDOM {
if (c == null) {
return PDOMBinding.EMPTY_PDOMBINDING_ARRAY;
}
- try {
- if (binding instanceof ICPPFunction) {
- ICPPFunction func = (ICPPFunction) binding;
- if (func.isExternC()) {
- result = FindBinding.findBinding(c.getIndex(), c,
- func.getNameCharArray(), new int[] { IIndexCBindingConstants.CFUNCTION }, 0);
- }
- } else if (binding instanceof ICPPVariable) {
- ICPPVariable var = (ICPPVariable) binding;
- if (var.isExternC()) {
- result = FindBinding.findBinding(c.getIndex(), c,
- var.getNameCharArray(), new int[] { IIndexCBindingConstants.CVARIABLE }, 0);
- }
- } else if (binding instanceof IEnumeration) {
- result= FindBinding.findBinding(c.getIndex(), c,
- binding.getNameCharArray(), new int[] {IIndexCBindingConstants.CENUMERATION }, 0);
- } else if (binding instanceof IEnumerator) {
- result= FindBinding.findBinding(c.getIndex(), c,
- binding.getNameCharArray(), new int[] {IIndexCBindingConstants.CENUMERATOR }, 0);
- } else if (binding instanceof ITypedef) {
- result= FindBinding.findBinding(c.getIndex(), c,
- binding.getNameCharArray(), new int[] {IIndexCBindingConstants.CTYPEDEF }, 0);
- } else if (binding instanceof ICompositeType) {
- final int key= ((ICompositeType) binding).getKey();
- if (key == ICompositeType.k_struct || key == ICompositeType.k_union) {
- result= FindBinding.findBinding(c.getIndex(), c,
- binding.getNameCharArray(), new int[] {IIndexCBindingConstants.CSTRUCTURE }, 0);
- if (result instanceof ICompositeType && ((ICompositeType) result).getKey() != key) {
- result= null;
- }
+ if (binding instanceof ICPPFunction) {
+ ICPPFunction func = (ICPPFunction) binding;
+ if (func.isExternC()) {
+ result = FindBinding.findBinding(c.getIndex(), c,
+ func.getNameCharArray(), new int[] { IIndexCBindingConstants.CFUNCTION }, 0);
+ }
+ } else if (binding instanceof ICPPVariable) {
+ ICPPVariable var = (ICPPVariable) binding;
+ if (var.isExternC()) {
+ result = FindBinding.findBinding(c.getIndex(), c,
+ var.getNameCharArray(), new int[] { IIndexCBindingConstants.CVARIABLE }, 0);
+ }
+ } else if (binding instanceof IEnumeration) {
+ result= FindBinding.findBinding(c.getIndex(), c,
+ binding.getNameCharArray(), new int[] {IIndexCBindingConstants.CENUMERATION }, 0);
+ } else if (binding instanceof IEnumerator) {
+ result= FindBinding.findBinding(c.getIndex(), c,
+ binding.getNameCharArray(), new int[] {IIndexCBindingConstants.CENUMERATOR }, 0);
+ } else if (binding instanceof ITypedef) {
+ result= FindBinding.findBinding(c.getIndex(), c,
+ binding.getNameCharArray(), new int[] {IIndexCBindingConstants.CTYPEDEF }, 0);
+ } else if (binding instanceof ICompositeType) {
+ final int key= ((ICompositeType) binding).getKey();
+ if (key == ICompositeType.k_struct || key == ICompositeType.k_union) {
+ result= FindBinding.findBinding(c.getIndex(), c,
+ binding.getNameCharArray(), new int[] {IIndexCBindingConstants.CSTRUCTURE }, 0);
+ if (result instanceof ICompositeType && ((ICompositeType) result).getKey() != key) {
+ result= null;
}
- }
- } catch (DOMException e) {
+ }
}
return result == null ? PDOMBinding.EMPTY_PDOMBINDING_ARRAY : new PDOMBinding[] {result};
}
@@ -1342,11 +1338,8 @@ public class PDOM extends PlatformObject implements IPDOM {
filter= new IndexFilter() {
@Override
public boolean acceptBinding(IBinding binding) {
- try {
- if (binding instanceof ICPPFunction) {
- return ((ICPPFunction) binding).isExternC();
- }
- } catch (DOMException e) {
+ if (binding instanceof ICPPFunction) {
+ return ((ICPPFunction) binding).isExternC();
}
return false;
}
@@ -1356,11 +1349,8 @@ public class PDOM extends PlatformObject implements IPDOM {
filter= new IndexFilter() {
@Override
public boolean acceptBinding(IBinding binding) {
- try {
- if (binding instanceof ICPPVariable) {
- return ((ICPPVariable) binding).isExternC();
- }
- } catch (DOMException e) {
+ if (binding instanceof ICPPVariable) {
+ return ((ICPPVariable) binding).isExternC();
}
return false;
}
@@ -1388,22 +1378,16 @@ public class PDOM extends PlatformObject implements IPDOM {
}
};
} else if (binding instanceof ICompositeType) {
- try {
- final int key = ((ICompositeType) binding).getKey();
- filter= new IndexFilter() {
- @Override
- public boolean acceptBinding(IBinding binding) {
- try {
- if (binding instanceof ICompositeType) {
- return ((ICompositeType) binding).getKey() == key;
- }
- } catch (DOMException e) {
- }
- return false;
+ final int key = ((ICompositeType) binding).getKey();
+ filter= new IndexFilter() {
+ @Override
+ public boolean acceptBinding(IBinding binding) {
+ if (binding instanceof ICompositeType) {
+ return ((ICompositeType) binding).getKey() == key;
}
- };
- } catch (DOMException e) {
- }
+ return false;
+ }
+ };
}
if (filter != null) {
BindingCollector collector= new BindingCollector(cpp, binding.getNameCharArray(), filter, false, true);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMASTAdapter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMASTAdapter.java
index 994aadb1f2..3fb480687c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMASTAdapter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMASTAdapter.java
@@ -269,7 +269,7 @@ public class PDOMASTAdapter {
return fDelegate.isSameType(type);
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return fDelegate.getOwner();
}
@@ -296,7 +296,7 @@ public class PDOMASTAdapter {
throw new PDOMNotImplementedError();
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
return fDelegate.findField(name);
}
@@ -305,15 +305,15 @@ public class PDOMASTAdapter {
return fDelegate.getAdapter(adapter);
}
- public IScope getCompositeScope() throws DOMException {
+ public IScope getCompositeScope() {
return fDelegate.getCompositeScope();
}
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
return fDelegate.getFields();
}
- public int getKey() throws DOMException {
+ public int getKey() {
return fDelegate.getKey();
}
@@ -337,11 +337,11 @@ public class PDOMASTAdapter {
return fDelegate.isSameType(type);
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return fDelegate.getOwner();
}
- public boolean isAnonymous() throws DOMException {
+ public boolean isAnonymous() {
return fDelegate.isAnonymous();
}
}
@@ -403,7 +403,7 @@ public class PDOMASTAdapter {
return fDelegate.isGloballyQualified();
}
- public IBinding getOwner() throws DOMException {
+ public IBinding getOwner() {
return fDelegate.getOwner();
}
}
@@ -447,51 +447,51 @@ public class PDOMASTAdapter {
super(name, delegate);
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
return ((ICPPClassType) fDelegate).findField(name);
}
- public ICPPMethod[] getAllDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getAllDeclaredMethods() {
return ((ICPPClassType) fDelegate).getAllDeclaredMethods();
}
- public ICPPBase[] getBases() throws DOMException {
+ public ICPPBase[] getBases() {
return ((ICPPClassType) fDelegate).getBases();
}
- public IScope getCompositeScope() throws DOMException {
+ public IScope getCompositeScope() {
return ((ICPPClassType) fDelegate).getCompositeScope();
}
- public ICPPConstructor[] getConstructors() throws DOMException {
+ public ICPPConstructor[] getConstructors() {
return ((ICPPClassType) fDelegate).getConstructors();
}
- public ICPPField[] getDeclaredFields() throws DOMException {
+ public ICPPField[] getDeclaredFields() {
return ((ICPPClassType) fDelegate).getDeclaredFields();
}
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getDeclaredMethods() {
return ((ICPPClassType) fDelegate).getDeclaredMethods();
}
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
return ((ICPPClassType) fDelegate).getFields();
}
- public IBinding[] getFriends() throws DOMException {
+ public IBinding[] getFriends() {
return ((ICPPClassType) fDelegate).getFriends();
}
- public int getKey() throws DOMException {
+ public int getKey() {
return ((ICPPClassType) fDelegate).getKey();
}
- public ICPPMethod[] getMethods() throws DOMException {
+ public ICPPMethod[] getMethods() {
return ((ICPPClassType) fDelegate).getMethods();
}
- public ICPPClassType[] getNestedClasses() throws DOMException {
+ public ICPPClassType[] getNestedClasses() {
return ((ICPPClassType) fDelegate).getNestedClasses();
}
@@ -499,7 +499,7 @@ public class PDOMASTAdapter {
return ((ICPPClassType) fDelegate).isSameType(type);
}
- public boolean isAnonymous() throws DOMException {
+ public boolean isAnonymous() {
return ((ICPPClassType) fDelegate).isAnonymous();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java
index 12cdac09ec..05f6860cd2 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java
@@ -432,20 +432,19 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding
return 0;
}
- public final IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
+ public final IBinding getBinding(IASTName name, boolean resolve) {
return getBinding(name, resolve, null);
}
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
return null;
}
- public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) throws DOMException {
+ public final IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix) {
return getBindings(name, resolve, prefix, null);
}
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix, IIndexFileSet fileSet)
- throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefix, IIndexFileSet fileSet) {
return null;
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java
index 9cfed220e7..4f5d26c04c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMLinkage.java
@@ -17,7 +17,6 @@ import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import org.eclipse.cdt.core.dom.IPDOMVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNode;
@@ -238,31 +237,28 @@ public abstract class PDOMLinkage extends PDOMNamedNode implements IIndexLinkage
protected PDOMFile getLocalToFile(IBinding binding, PDOMBinding glob) throws CoreException {
if (fPDOM instanceof WritablePDOM) {
final WritablePDOM wpdom= (WritablePDOM) fPDOM;
- try {
- if (binding instanceof IField) {
- return null;
- }
- boolean checkIfInSourceOnly= false;
- boolean requireDefinition= false;
- if (binding instanceof IVariable) {
- if (!(binding instanceof IField)) {
- checkIfInSourceOnly= ((IVariable) binding).isStatic();
- }
- } else if (binding instanceof IFunction) {
- IFunction f= (IFunction) binding;
- checkIfInSourceOnly= ASTInternal.isStatic(f, false);
- } else if (binding instanceof ITypedef || binding instanceof ICompositeType || binding instanceof IEnumeration) {
- checkIfInSourceOnly= true;
- requireDefinition= true;
+ if (binding instanceof IField) {
+ return null;
+ }
+ boolean checkIfInSourceOnly= false;
+ boolean requireDefinition= false;
+ if (binding instanceof IVariable) {
+ if (!(binding instanceof IField)) {
+ checkIfInSourceOnly= ((IVariable) binding).isStatic();
}
+ } else if (binding instanceof IFunction) {
+ IFunction f= (IFunction) binding;
+ checkIfInSourceOnly= ASTInternal.isStatic(f, false);
+ } else if (binding instanceof ITypedef || binding instanceof ICompositeType || binding instanceof IEnumeration) {
+ checkIfInSourceOnly= true;
+ requireDefinition= true;
+ }
- if (checkIfInSourceOnly) {
- String path= ASTInternal.getDeclaredInSourceFileOnly(binding, requireDefinition, glob);
- if (path != null) {
- return wpdom.getFileForASTPath(getLinkageID(), path);
- }
+ if (checkIfInSourceOnly) {
+ String path= ASTInternal.getDeclaredInSourceFileOnly(binding, requireDefinition, glob);
+ if (path != null) {
+ return wpdom.getFileForASTPath(getLinkageID(), path);
}
- } catch (DOMException e) {
}
}
return null;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCAnnotation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCAnnotation.java
index 989b07165b..d505b8b584 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCAnnotation.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation.
+ * Copyright (c) 2006, 2010 IBM Corporation.
* 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.pdom.dom.c;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IFunction;
import org.eclipse.cdt.core.dom.ast.IVariable;
@@ -44,9 +43,8 @@ public class PDOMCAnnotation {
*
* @param binding the IBinding whose annotation will be encoded.
* @return a bit vector of the annotation.
- * @throws DOMException
*/
- public static byte encodeAnnotation(IBinding binding) throws DOMException {
+ public static byte encodeAnnotation(IBinding binding) {
byte modifiers = 0;
if (binding instanceof IVariable) {
IVariable variable = (IVariable) binding;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCFunction.java
index 1d68bb7953..7e68e054d4 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCFunction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 QNX Software Systems and others.
+ * Copyright (c) 2006, 2010 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
@@ -152,11 +152,11 @@ class PDOMCFunction extends PDOMBinding implements IFunction {
}
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.STATIC_OFFSET);
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.EXTERN_OFFSET);
}
@@ -184,21 +184,21 @@ class PDOMCFunction extends PDOMBinding implements IFunction {
}
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
// ISO/IEC 9899:TC1 6.9.1.4
return false;
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
// ISO/IEC 9899:TC1 6.9.1.4
return false;
}
- public boolean isInline() throws DOMException {
+ public boolean isInline() {
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.INLINE_OFFSET);
}
- public boolean takesVarArgs() throws DOMException {
+ public boolean takesVarArgs() {
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.VARARGS_OFFSET);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java
index b8f1c653d2..54f1afefaa 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCLinkage.java
@@ -26,7 +26,6 @@ import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
import org.eclipse.cdt.core.dom.ast.IVariable;
import org.eclipse.cdt.core.index.IIndexBinding;
-import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.dom.parser.ITypeMarshalBuffer;
import org.eclipse.cdt.internal.core.dom.parser.c.CArrayType;
import org.eclipse.cdt.internal.core.dom.parser.c.CBasicType;
@@ -206,30 +205,26 @@ class PDOMCLinkage extends PDOMLinkage implements IIndexCBindingConstants {
* @throws CoreException
*/
final private PDOMNode getAdaptedParent(IBinding binding) throws CoreException {
- try {
- if (binding instanceof IIndexBinding) {
- IIndexBinding ib= (IIndexBinding) binding;
- if (ib.isFileLocal()) {
- return null;
- }
- }
-
- IBinding owner= binding.getOwner();
- // For plain c the enumeration type is not the parent of the enumeration item.
- if (owner instanceof IEnumeration) {
- owner= owner.getOwner();
- }
- if (owner == null) {
- return this;
- }
- if (owner instanceof IFunction) {
+ if (binding instanceof IIndexBinding) {
+ IIndexBinding ib= (IIndexBinding) binding;
+ if (ib.isFileLocal()) {
return null;
}
-
- return adaptBinding(owner);
- } catch (DOMException e) {
- throw new CoreException(Util.createStatus(e));
+ }
+
+ IBinding owner= binding.getOwner();
+ // For plain c the enumeration type is not the parent of the enumeration item.
+ if (owner instanceof IEnumeration) {
+ owner= owner.getOwner();
+ }
+ if (owner == null) {
+ return this;
}
+ if (owner instanceof IFunction) {
+ return null;
+ }
+
+ return adaptBinding(owner);
}
@Override
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCParameter.java
index 83fa923111..b46776ec79 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCParameter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 QNX Software Systems and others.
+ * Copyright (c) 2006, 2010 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
@@ -74,12 +74,12 @@ final class PDOMCParameter extends PDOMNamedNode implements IParameter, IPDOMBin
return fType;
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
byte flag = 1<<PDOMCAnnotation.AUTO_OFFSET;
return hasFlag(flag, true);
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
byte flag = 1<<PDOMCAnnotation.REGISTER_OFFSET;
return hasFlag(flag, false);
}
@@ -170,12 +170,8 @@ final class PDOMCParameter extends PDOMNamedNode implements IParameter, IPDOMBin
protected byte encodeFlags(IParameter param) {
// C99 ISO/IEC 9899: 6.7.5.3.2
byte flags= 0;
- try {
- flags |= (param.isAuto() ? 1 : 0) << PDOMCAnnotation.AUTO_OFFSET;
- flags |= (param.isRegister() ? 1 : 0) << PDOMCAnnotation.REGISTER_OFFSET;
- } catch (DOMException e) {
- // ignore and miss out on some flags
- }
+ flags |= (param.isAuto() ? 1 : 0) << PDOMCAnnotation.AUTO_OFFSET;
+ flags |= (param.isRegister() ? 1 : 0) << PDOMCAnnotation.REGISTER_OFFSET;
return flags;
}
@@ -190,11 +186,11 @@ final class PDOMCParameter extends PDOMNamedNode implements IParameter, IPDOMBin
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return false;
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return false;
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCStructure.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCStructure.java
index 66bb7e5498..8d91c4280a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCStructure.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCStructure.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 QNX Software Systems and others.
+ * Copyright (c) 2006, 2010 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
@@ -18,7 +18,6 @@ import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.IPDOMNode;
import org.eclipse.cdt.core.dom.IPDOMVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -31,7 +30,6 @@ import org.eclipse.cdt.core.dom.ast.c.ICCompositeTypeScope;
import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.core.index.IndexFilter;
-import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.index.IIndexCBindingConstants;
import org.eclipse.cdt.internal.core.index.IIndexScope;
import org.eclipse.cdt.internal.core.index.IIndexType;
@@ -82,19 +80,11 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
}
private void setKind(ICompositeType ct) throws CoreException {
- try {
- getDB().putByte(record + KEY, (byte) ct.getKey());
- } catch (DOMException e) {
- throw new CoreException(Util.createStatus(e));
- }
+ getDB().putByte(record + KEY, (byte) ct.getKey());
}
private void setAnonymous(ICompositeType ct) throws CoreException {
- try {
- getDB().putByte(record + ANONYMOUS, (byte) (ct.isAnonymous() ? 1 : 0));
- } catch (DOMException e) {
- throw new CoreException(Util.createStatus(e));
- }
+ getDB().putByte(record + ANONYMOUS, (byte) (ct.isAnonymous() ? 1 : 0));
}
@@ -114,7 +104,7 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
throw new UnsupportedOperationException();
}
- public int getKey() throws DOMException {
+ public int getKey() {
try {
return getDB().getByte(record + KEY);
} catch (CoreException e) {
@@ -123,7 +113,7 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
}
}
- public boolean isAnonymous() throws DOMException {
+ public boolean isAnonymous() {
try {
return getDB().getByte(record + ANONYMOUS) != 0;
} catch (CoreException e) {
@@ -141,11 +131,8 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
fields.add(node);
}
} else if (node instanceof ICompositeType) {
- try {
- if (((ICompositeType) node).isAnonymous()) {
- return true; // visit children
- }
- } catch (DOMException e) {
+ if (((ICompositeType) node).isAnonymous()) {
+ return true; // visit children
}
}
return false;
@@ -156,7 +143,7 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
return fields.toArray(new IField[fields.size()]);
}
}
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
try {
GetFields fields = new GetFields();
accept(fields);
@@ -183,11 +170,8 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
}
}
} else if (node instanceof ICompositeType) {
- try {
- if (((ICompositeType) node).isAnonymous()) {
- return true; // visit children
- }
- } catch (DOMException e) {
+ if (((ICompositeType) node).isAnonymous()) {
+ return true; // visit children
}
}
return false;
@@ -197,7 +181,7 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
public IField getField() { return field; }
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
final PDOM pdom = getPDOM();
final String key= pdom.createKeyForCache(record, name.toCharArray());
IField result= (IField) pdom.getCachedResult(key);
@@ -272,25 +256,25 @@ public class PDOMCStructure extends PDOMBinding implements ICompositeType, ICCom
return this;
}
- public IBinding getBinding(char[] name) throws DOMException {
+ public IBinding getBinding(char[] name) {
return findField(new String(name));
}
@Override
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
return getBinding(name.toCharArray());
}
@Override
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
return getBindings(name.toCharArray());
}
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
return getBindings(name.toCharArray());
}
- private IBinding[] getBindings(char[] name) throws DOMException {
+ private IBinding[] getBindings(char[] name) {
IBinding b= getBinding(name);
if (b == null)
return IBinding.EMPTY_BINDING_ARRAY;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCVariable.java
index fab027692b..8c3b1ddaf4 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCVariable.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/c/PDOMCVariable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 QNX Software Systems and others.
+ * Copyright (c) 2006, 2010 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
@@ -136,19 +136,19 @@ class PDOMCVariable extends PDOMBinding implements IVariable {
}
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.STATIC_OFFSET);
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.EXTERN_OFFSET);
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.AUTO_OFFSET);
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return getBit(getByte(record + ANNOTATIONS), PDOMCAnnotation.REGISTER_OFFSET);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPAnnotation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPAnnotation.java
index 205f4c5db6..3d599c671e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPAnnotation.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation.
+ * Copyright (c) 2006, 2010 IBM Corporation.
* 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
@@ -47,9 +47,8 @@ class PDOMCPPAnnotation {
*
* @param binding the IBinding whose annotation will be encoded.
* @return a bit vector of the annotation.
- * @throws DOMException
*/
- public static byte encodeAnnotation(IBinding binding) throws DOMException {
+ public static byte encodeAnnotation(IBinding binding) {
byte modifiers = PDOMCAnnotation.encodeAnnotation(binding);
if (binding instanceof ICPPMember) {
ICPPMember member = (ICPPMember) binding;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPBase.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPBase.java
index e17657ca81..15ce48f1f8 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPBase.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPBase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 QNX Software Systems and others.
+ * Copyright (c) 2006, 2010 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
@@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.core.pdom.dom.cpp;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.IName;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBase;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPInternalBase;
@@ -149,7 +148,7 @@ class PDOMCPPBase implements ICPPBase, ICPPInternalBase {
public PDOMCPPBaseClone(ICPPBase base) {
this.base = base;
}
- public IBinding getBaseClass() throws DOMException {
+ public IBinding getBaseClass() {
if (baseClass == null) {
return base.getBaseClass();
}
@@ -158,10 +157,10 @@ class PDOMCPPBase implements ICPPBase, ICPPInternalBase {
public IName getBaseClassSpecifierName() {
return base.getBaseClassSpecifierName();
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return base.getVisibility();
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return base.isVirtual();
}
public void setBaseClass(IBinding binding) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassScope.java
index ee5f3443d5..d4c75b5cc2 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassScope.java
@@ -23,7 +23,6 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.ILinkage;
import org.eclipse.cdt.core.dom.IPDOMNode;
import org.eclipse.cdt.core.dom.IPDOMVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -73,11 +72,8 @@ class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
fResult.put(nchars, list);
}
list.add(binding);
- try {
- if (binding instanceof ICompositeType && ((ICompositeType) binding).isAnonymous()) {
- return true; // visit children
- }
- } catch (DOMException e) {
+ if (binding instanceof ICompositeType && ((ICompositeType) binding).isAnonymous()) {
+ return true; // visit children
}
}
return false;
@@ -109,15 +105,15 @@ class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
return fBinding;
}
- public IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve) {
return getBinding(name, resolve, null);
}
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup) throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup) {
return getBindings(name, resolve, prefixLookup, null);
}
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
try {
final char[] nameChars = name.getSimpleID();
if (CharArrayUtils.equals(fBinding.getNameCharArray(), nameChars)) {
@@ -133,7 +129,7 @@ class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
return null;
}
- private IBinding getClassNameBinding() throws DOMException {
+ private IBinding getClassNameBinding() {
if (fBinding instanceof ICPPClassTemplatePartialSpecialization)
return ((ICPPClassTemplatePartialSpecialization) fBinding).getPrimaryClassTemplate();
if (fBinding instanceof ICPPSpecialization)
@@ -141,7 +137,7 @@ class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
return fBinding;
}
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
try {
if (name instanceof ICPPASTConversionName) {
BindingCollector visitor = new BindingCollector(fBinding.getLinkage(), Keywords.cOPERATOR, CONVERSION_FILTER, true, true);
@@ -244,7 +240,7 @@ class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
return map;
}
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
return CPPSemantics.findBindings( this, name, false );
}
@@ -262,7 +258,7 @@ class PDOMCPPClassScope implements ICPPClassScope, IIndexScope {
}
}
- public ICPPConstructor[] getConstructors() throws DOMException {
+ public ICPPConstructor[] getConstructors() {
return fBinding.getConstructors();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java
index 7a6e704606..6918f243b5 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java
@@ -18,7 +18,6 @@ import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.IPDOMVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IScope;
@@ -182,7 +181,7 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
}
// implementation of class type
- public ICPPBase[] getBases() throws DOMException {
+ public ICPPBase[] getBases() {
IScope scope= getCompositeScope();
if (scope instanceof ICPPClassSpecializationScope) {
return ((ICPPClassSpecializationScope) scope).getBases();
@@ -208,7 +207,7 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
return ICPPBase.EMPTY_BASE_ARRAY;
}
- public ICPPConstructor[] getConstructors() throws DOMException {
+ public ICPPConstructor[] getConstructors() {
IScope scope= getCompositeScope();
if (scope instanceof ICPPClassSpecializationScope) {
return ((ICPPClassSpecializationScope) scope).getConstructors();
@@ -223,7 +222,7 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
}
}
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getDeclaredMethods() {
IScope scope= getCompositeScope();
if (scope instanceof ICPPClassSpecializationScope) {
return ((ICPPClassSpecializationScope) scope).getDeclaredMethods();
@@ -238,7 +237,7 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
}
}
- public ICPPField[] getDeclaredFields() throws DOMException {
+ public ICPPField[] getDeclaredFields() {
IScope scope= getCompositeScope();
if (scope instanceof ICPPClassSpecializationScope) {
return ((ICPPClassSpecializationScope) scope).getDeclaredFields();
@@ -253,7 +252,7 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
}
}
- public ICPPClassType[] getNestedClasses() throws DOMException {
+ public ICPPClassType[] getNestedClasses() {
IScope scope= getCompositeScope();
if (scope instanceof ICPPClassSpecializationScope) {
return ((ICPPClassSpecializationScope) scope).getNestedClasses();
@@ -268,28 +267,28 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
}
}
- public IBinding[] getFriends() throws DOMException {
+ public IBinding[] getFriends() {
// not yet supported.
return IBinding.EMPTY_BINDING_ARRAY;
}
- public ICPPMethod[] getMethods() throws DOMException {
+ public ICPPMethod[] getMethods() {
return ClassTypeHelper.getMethods(this);
}
- public ICPPMethod[] getAllDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getAllDeclaredMethods() {
return ClassTypeHelper.getAllDeclaredMethods(this);
}
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
return ClassTypeHelper.getFields(this);
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
return ClassTypeHelper.findField(this, name);
}
- public int getKey() throws DOMException {
+ public int getKey() {
return (getSpecializedBinding()).getKey();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java
index 8a17263bb9..384de439be 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassTemplate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -177,8 +177,7 @@ public class PDOMCPPClassTemplate extends PDOMCPPClassType
}
}
int pos= newParamLength;
- for (int j = 0; j < allParams.length; j++) {
- IPDOMCPPTemplateParameter unused = allParams[j];
+ for (IPDOMCPPTemplateParameter unused : allParams) {
if (unused != null)
newAllParams[pos++]= unused;
}
@@ -250,21 +249,17 @@ public class PDOMCPPClassTemplate extends PDOMCPPClassType
type instanceof ICPPClassSpecialization)
return false;
- try {
- ICPPClassType ctype= (ICPPClassType) type;
- if (ctype.getKey() != getKey())
- return false;
- char[] nchars = ctype.getNameCharArray();
- if (nchars.length == 0) {
- nchars= ASTTypeUtil.createNameForAnonymous(ctype);
- }
- if (nchars == null || !CharArrayUtils.equals(nchars, getNameCharArray()))
- return false;
-
- return SemanticUtil.isSameOwner(getOwner(), ctype.getOwner());
- } catch (DOMException e) {
+ ICPPClassType ctype= (ICPPClassType) type;
+ if (ctype.getKey() != getKey())
return false;
+ char[] nchars = ctype.getNameCharArray();
+ if (nchars.length == 0) {
+ nchars= ASTTypeUtil.createNameForAnonymous(ctype);
}
+ if (nchars == null || !CharArrayUtils.equals(nchars, getNameCharArray()))
+ return false;
+
+ return SemanticUtil.isSameOwner(getOwner(), ctype.getOwner());
}
public ICPPTemplateInstance getInstance(ICPPTemplateArgument[] arguments) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java
index fa060cabbe..a8dcfa6dee 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 QNX Software Systems and others.
+ * Copyright (c) 2005, 2010 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
@@ -21,7 +21,6 @@ import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.IPDOMVisitor;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IField;
import org.eclipse.cdt.core.dom.ast.IType;
@@ -33,7 +32,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
-import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.dom.parser.ProblemBinding;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper;
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
@@ -98,19 +96,11 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
}
private void setKind(ICPPClassType ct) throws CoreException {
- try {
- getDB().putByte(record + KEY, (byte) ct.getKey());
- } catch (DOMException e) {
- throw new CoreException(Util.createStatus(e));
- }
+ getDB().putByte(record + KEY, (byte) ct.getKey());
}
private void setAnonymous(ICPPClassType ct) throws CoreException {
- try {
- getDB().putByte(record + ANONYMOUS, (byte) (ct.isAnonymous() ? 1 : 0));
- } catch (DOMException e) {
- throw new CoreException(Util.createStatus(e));
- }
+ getDB().putByte(record + ANONYMOUS, (byte) (ct.isAnonymous() ? 1 : 0));
}
@Override
@@ -220,14 +210,14 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
}
}
- public ICPPClassScope getCompositeScope() throws DOMException {
+ public ICPPClassScope getCompositeScope() {
if (fScope == null) {
fScope= new PDOMCPPClassScope(this);
}
return fScope;
}
- public int getKey() throws DOMException {
+ public int getKey() {
try {
return getDB().getByte(record + KEY);
} catch (CoreException e) {
@@ -236,7 +226,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
}
}
- public boolean isAnonymous() throws DOMException {
+ public boolean isAnonymous() {
try {
return getDB().getByte(record + ANONYMOUS) != 0;
} catch (CoreException e) {
@@ -259,25 +249,21 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
if (type instanceof ICPPClassType && !(type instanceof ProblemBinding)) {
ICPPClassType ctype= (ICPPClassType) type;
- try {
- if (ctype.getKey() != getKey())
- return false;
- char[] nchars = ctype.getNameCharArray();
- if (nchars.length == 0) {
- nchars= ASTTypeUtil.createNameForAnonymous(ctype);
- }
- if (nchars == null || !CharArrayUtils.equals(nchars, getNameCharArray()))
- return false;
-
- return SemanticUtil.isSameOwner(getOwner(), ctype.getOwner());
- } catch (DOMException e) {
- CCorePlugin.log(e);
+ if (ctype.getKey() != getKey())
+ return false;
+ char[] nchars = ctype.getNameCharArray();
+ if (nchars.length == 0) {
+ nchars= ASTTypeUtil.createNameForAnonymous(ctype);
}
+ if (nchars == null || !CharArrayUtils.equals(nchars, getNameCharArray()))
+ return false;
+
+ return SemanticUtil.isSameOwner(getOwner(), ctype.getOwner());
}
return false;
}
- public ICPPBase[] getBases() throws DOMException {
+ public ICPPBase[] getBases() {
Long key= record + PDOMCPPLinkage.CACHE_BASES;
ICPPBase[] bases= (ICPPBase[]) getPDOM().getCachedResult(key);
if (bases != null)
@@ -297,7 +283,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
}
}
- public ICPPConstructor[] getConstructors() throws DOMException {
+ public ICPPConstructor[] getConstructors() {
PDOMClassUtil.ConstructorCollector visitor= new PDOMClassUtil.ConstructorCollector();
try {
PDOMCPPClassScope.acceptViaCache(this, visitor, false);
@@ -308,7 +294,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
}
}
- public ICPPMethod[] getDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getDeclaredMethods() {
try {
PDOMClassUtil.MethodCollector methods = new PDOMClassUtil.MethodCollector(false);
PDOMCPPClassScope.acceptViaCache(this, methods, false);
@@ -319,7 +305,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
}
}
- public ICPPField[] getDeclaredFields() throws DOMException {
+ public ICPPField[] getDeclaredFields() {
try {
PDOMClassUtil.FieldCollector visitor = new PDOMClassUtil.FieldCollector();
PDOMCPPClassScope.acceptViaCache(this, visitor, false);
@@ -330,7 +316,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
}
}
- public ICPPClassType[] getNestedClasses() throws DOMException {
+ public ICPPClassType[] getNestedClasses() {
try {
PDOMClassUtil.NestedClassCollector visitor = new PDOMClassUtil.NestedClassCollector();
PDOMCPPClassScope.acceptViaCache(this, visitor, false);
@@ -341,7 +327,7 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
}
}
- public IBinding[] getFriends() throws DOMException {
+ public IBinding[] getFriends() {
try {
final List<IBinding> list = new ArrayList<IBinding>();
for (PDOMCPPFriend friend = getFirstFriend();
@@ -355,19 +341,19 @@ class PDOMCPPClassType extends PDOMCPPBinding implements IPDOMCPPClassType, IPDO
}
}
- public ICPPMethod[] getMethods() throws DOMException {
+ public ICPPMethod[] getMethods() {
return ClassTypeHelper.getMethods(this);
}
- public ICPPMethod[] getAllDeclaredMethods() throws DOMException {
+ public ICPPMethod[] getAllDeclaredMethods() {
return ClassTypeHelper.getAllDeclaredMethods(this);
}
- public IField[] getFields() throws DOMException {
+ public IField[] getFields() {
return ClassTypeHelper.getFields(this);
}
- public IField findField(String name) throws DOMException {
+ public IField findField(String name) {
return ClassTypeHelper.findField(this, name);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructor.java
index 170ff494a4..ddd8db8fb6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructor.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2010 Wind River Systems, Inc. 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
@@ -29,7 +29,7 @@ class PDOMCPPConstructor extends PDOMCPPMethod implements ICPPConstructor {
super(linkage, record);
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return getBit(getAnnotation1(), PDOMCPPAnnotation.EXPLICIT_CONSTRUCTOR_OFFSET);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorInstance.java
index b3af609e15..2759f273c6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorInstance.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
@@ -51,7 +50,7 @@ public class PDOMCPPConstructorInstance extends PDOMCPPMethodInstance implements
return IIndexCPPBindingConstants.CPP_CONSTRUCTOR_INSTANCE;
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return ((ICPPConstructor)getTemplateDefinition()).isExplicit();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorSpecialization.java
index 3f9a10905f..01cf06f835 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
@@ -49,7 +48,7 @@ class PDOMCPPConstructorSpecialization extends
return IIndexCPPBindingConstants.CPP_CONSTRUCTOR_SPECIALIZATION;
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.EXPLICIT_CONSTRUCTOR_OFFSET);
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorTemplate.java
index 9642d8909e..76c8c45c83 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorTemplate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -33,7 +33,7 @@ class PDOMCPPConstructorTemplate extends PDOMCPPMethodTemplate implements
super(linkage, record);
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return getBit(getAnnotation1(), PDOMCPPAnnotation.EXPLICIT_CONSTRUCTOR_OFFSET);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorTemplateSpecialization.java
index e787307f4a..2155a317ad 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorTemplateSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPConstructorTemplateSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding;
@@ -50,7 +49,7 @@ class PDOMCPPConstructorTemplateSpecialization extends
return IIndexCPPBindingConstants.CPP_CONSTRUCTOR_TEMPLATE_SPECIALIZATION;
}
- public boolean isExplicit() throws DOMException {
+ public boolean isExplicit() {
return ((ICPPConstructor)getSpecializedBinding()).isExplicit();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPDeferredClassInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPDeferredClassInstance.java
index e6fc9322bd..f5cf030d33 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPDeferredClassInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPDeferredClassInstance.java
@@ -85,7 +85,7 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPSpecialization implements ICPP
return false;
}
- public IScope getCompositeScope() throws DOMException {
+ public IScope getCompositeScope() {
return asScope();
}
@@ -169,14 +169,14 @@ class PDOMCPPDeferredClassInstance extends PDOMCPPSpecialization implements ICPP
return ICPPClassType.EMPTY_CLASS_ARRAY;
}
- public int getKey() throws DOMException{
+ public int getKey(){
return getClassTemplate().getKey();
}
@Override
public Object clone() {fail();return null;}
- public ICPPScope asScope() throws DOMException {
+ public ICPPScope asScope() {
if (unknownScope == null) {
unknownScope= new PDOMCPPUnknownScope(this, getUnknownName());
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java
index 83b1a99e35..c9633d6b9e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumScope.java
@@ -18,7 +18,6 @@ import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.IPDOMVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -49,15 +48,15 @@ class PDOMCPPEnumScope implements ICPPScope, IIndexScope {
return EScopeKind.eEnumeration;
}
- public IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve) {
return getBinding(name, resolve, null);
}
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup) throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup) {
return getBindings(name, resolve, prefixLookup, null);
}
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
try {
CharArrayMap<PDOMCPPEnumerator> map= getBindingMap(fBinding);
return map.get(name.toCharArray());
@@ -67,7 +66,7 @@ class PDOMCPPEnumScope implements ICPPScope, IIndexScope {
}
}
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
try {
CharArrayMap<PDOMCPPEnumerator> map= getBindingMap(fBinding);
if (prefixLookup) {
@@ -90,7 +89,7 @@ class PDOMCPPEnumScope implements ICPPScope, IIndexScope {
return IBinding.EMPTY_BINDING_ARRAY;
}
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
return CPPSemantics.findBindings(this, name, false);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumeration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumeration.java
index c4c707c0cd..6f3b3cbe6d 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumeration.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPEnumeration.java
@@ -16,7 +16,6 @@ import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.IPDOMNode;
import org.eclipse.cdt.core.dom.IPDOMVisitor;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IEnumeration;
import org.eclipse.cdt.core.dom.ast.IEnumerator;
@@ -135,20 +134,16 @@ class PDOMCPPEnumeration extends PDOMCPPBinding implements IPDOMCPPEnumType, IPD
}
}
- try {
- if (type instanceof IEnumeration) {
- IEnumeration etype= (IEnumeration) type;
- char[] nchars = etype.getNameCharArray();
- if (nchars.length == 0) {
- nchars= ASTTypeUtil.createNameForAnonymous(etype);
- }
- if (nchars == null || !CharArrayUtils.equals(nchars, getNameCharArray()))
- return false;
-
- return SemanticUtil.isSameOwner(getOwner(), etype.getOwner());
+ if (type instanceof IEnumeration) {
+ IEnumeration etype= (IEnumeration) type;
+ char[] nchars = etype.getNameCharArray();
+ if (nchars.length == 0) {
+ nchars= ASTTypeUtil.createNameForAnonymous(etype);
}
- } catch (DOMException e) {
- CCorePlugin.log(e);
+ if (nchars == null || !CharArrayUtils.equals(nchars, getNameCharArray()))
+ return false;
+
+ return SemanticUtil.isSameOwner(getOwner(), etype.getOwner());
}
return false;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFieldSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFieldSpecialization.java
index 94fb13b9fa..0eaa5bfa30 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFieldSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFieldSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -71,7 +71,7 @@ class PDOMCPPFieldSpecialization extends PDOMCPPSpecialization implements ICPPFi
return (ICPPField) getSpecializedBinding();
}
- public ICompositeType getCompositeTypeOwner() throws DOMException {
+ public ICompositeType getCompositeTypeOwner() {
return getClassOwner();
}
@@ -95,11 +95,11 @@ class PDOMCPPFieldSpecialization extends PDOMCPPSpecialization implements ICPPFi
}
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return getField().isAuto();
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return getField().isExtern();
}
@@ -107,23 +107,23 @@ class PDOMCPPFieldSpecialization extends PDOMCPPSpecialization implements ICPPFi
return false;
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return getField().isRegister();
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return getField().isStatic();
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
return (ICPPClassType) getOwner();
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return getField().getVisibility();
}
- public boolean isMutable() throws DOMException {
+ public boolean isMutable() {
return getField().isMutable();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunction.java
index c972adea00..0dcaf92dd7 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunction.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunction.java
@@ -99,7 +99,7 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
}
}
- private short getAnnotation(ICPPFunction function) throws DOMException {
+ private short getAnnotation(ICPPFunction function) {
int annot= PDOMCPPAnnotation.encodeAnnotation(function) & 0xff;
if (function.hasParameterPack()) {
annot |= (1<<ANNOT_PARAMETER_PACK);
@@ -190,12 +190,7 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
// don't store the exception specification, compute it on demand.
exceptionSpec= null;
} else {
- try{
- exceptionSpec= binding.getExceptionSpecification();
- } catch (DOMException e) {
- // ignore problems in the exception specification.
- exceptionSpec= null;
- }
+ exceptionSpec= binding.getExceptionSpecification();
}
return exceptionSpec;
}
@@ -271,11 +266,11 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
return fAnnotation;
}
- public boolean isExternC() throws DOMException {
+ public boolean isExternC() {
return getBit(getAnnotation(), PDOMCPPAnnotation.EXTERN_C_OFFSET);
}
- public boolean isMutable() throws DOMException {
+ public boolean isMutable() {
throw new PDOMNotImplementedError();
}
@@ -340,7 +335,7 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
return getBit(getAnnotation(), PDOMCAnnotation.STATIC_OFFSET);
}
- public boolean takesVarArgs() throws DOMException {
+ public boolean takesVarArgs() {
return getBit(getAnnotation(), PDOMCAnnotation.VARARGS_OFFSET);
}
@@ -375,7 +370,7 @@ class PDOMCPPFunction extends PDOMCPPBinding implements ICPPFunction, IPDOMOverl
return 0;
}
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
try {
final long rec = getPDOM().getDB().getRecPtr(record+EXCEPTION_SPEC);
return PDOMCPPTypeList.getTypes(this, rec);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionInstance.java
index a6f14b6baa..23451750ee 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionInstance.java
@@ -13,7 +13,6 @@
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateArgument;
@@ -48,12 +47,8 @@ class PDOMCPPFunctionInstance extends PDOMCPPFunctionSpecialization implements I
final Database db = getDB();
db.putRecPtr(record+ARGUMENTS, argListRec);
- try {
- long exceptSpecRec = PDOMCPPTypeList.putTypes(this, function.getExceptionSpecification());
- db.putRecPtr(record+EXCEPTION_SPEC, exceptSpecRec);
- } catch (DOMException e) {
- // ignore problems in the exception specification
- }
+ long exceptSpecRec = PDOMCPPTypeList.putTypes(this, function.getExceptionSpecification());
+ db.putRecPtr(record+EXCEPTION_SPEC, exceptSpecRec);
}
public PDOMCPPFunctionInstance(PDOMLinkage linkage, long bindingRecord) {
@@ -93,7 +88,7 @@ class PDOMCPPFunctionInstance extends PDOMCPPFunctionSpecialization implements I
}
@Override
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
try {
final long rec = getPDOM().getDB().getRecPtr(record+EXCEPTION_SPEC);
return PDOMCPPTypeList.getTypes(this, rec);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionSpecialization.java
index 93f48d1dfa..e601bf5928 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPFunctionSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -122,21 +122,17 @@ class PDOMCPPFunctionSpecialization extends PDOMCPPSpecialization implements ICP
} catch (DOMException e) {
throw new CoreException(Util.createStatus(e));
}
- try {
- long typelist= 0;
- if (astFunction instanceof ICPPMethod && ((ICPPMethod) astFunction).isImplicit()) {
- // don't store the exception specification, computed it on demand.
- } else {
- typelist = PDOMCPPTypeList.putTypes(this, astFunction.getExceptionSpecification());
- }
- db.putRecPtr(record + EXCEPTION_SPEC, typelist);
- } catch (DOMException e) {
- // ignore problems in the exception specification
+ long typelist= 0;
+ if (astFunction instanceof ICPPMethod && ((ICPPMethod) astFunction).isImplicit()) {
+ // don't store the exception specification, computed it on demand.
+ } else {
+ typelist = PDOMCPPTypeList.putTypes(this, astFunction.getExceptionSpecification());
}
+ db.putRecPtr(record + EXCEPTION_SPEC, typelist);
}
- private short getAnnotation(ICPPFunction astFunction) throws DOMException {
+ private short getAnnotation(ICPPFunction astFunction) {
int annot= PDOMCPPAnnotation.encodeAnnotation(astFunction) & 0xff;
if (astFunction.hasParameterPack()) {
annot |= (1 << ANNOT_PARAMETER_PACK);
@@ -161,7 +157,7 @@ class PDOMCPPFunctionSpecialization extends PDOMCPPSpecialization implements ICP
return IIndexCPPBindingConstants.CPP_FUNCTION_SPECIALIZATION;
}
- public boolean isInline() throws DOMException {
+ public boolean isInline() {
return getBit(readAnnotation(), PDOMCAnnotation.INLINE_OFFSET);
}
@@ -176,7 +172,7 @@ class PDOMCPPFunctionSpecialization extends PDOMCPPSpecialization implements ICP
return fAnnotation;
}
- public boolean isMutable() throws DOMException {
+ public boolean isMutable() {
return false;
}
@@ -219,29 +215,29 @@ class PDOMCPPFunctionSpecialization extends PDOMCPPSpecialization implements ICP
return fType;
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
// ISO/IEC 14882:2003 7.1.1.2
return false;
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return getBit(readAnnotation(), PDOMCAnnotation.EXTERN_OFFSET);
}
- public boolean isExternC() throws DOMException {
+ public boolean isExternC() {
return getBit(readAnnotation(), PDOMCPPAnnotation.EXTERN_C_OFFSET);
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
// ISO/IEC 14882:2003 7.1.1.2
return false;
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return getBit(readAnnotation(), PDOMCAnnotation.STATIC_OFFSET);
}
- public boolean takesVarArgs() throws DOMException {
+ public boolean takesVarArgs() {
return getBit(readAnnotation(), PDOMCAnnotation.VARARGS_OFFSET);
}
@@ -283,7 +279,7 @@ class PDOMCPPFunctionSpecialization extends PDOMCPPSpecialization implements ICP
return cmp==0 ? PDOMCPPFunction.compareSignatures(this, other) : cmp;
}
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
try {
final long rec = getPDOM().getDB().getRecPtr(record+EXCEPTION_SPEC);
return PDOMCPPTypeList.getTypes(this, rec);
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
index 6cd2a68016..76f3bb5a0a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPLinkage.java
@@ -693,36 +693,32 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
* @throws CoreException
*/
private final PDOMNode adaptOrAddParent(boolean add, IBinding binding) throws CoreException {
- try {
- IBinding owner= binding.getOwner();
- if (owner instanceof IFunction && !(binding instanceof ICPPTemplateParameter)) {
- return null;
- }
+ IBinding owner= binding.getOwner();
+ if (owner instanceof IFunction && !(binding instanceof ICPPTemplateParameter)) {
+ return null;
+ }
- if (binding instanceof IIndexBinding) {
- IIndexBinding ib= (IIndexBinding) binding;
- // don't adapt file local bindings from other fragments to this one.
- if (ib.isFileLocal()) {
- return null;
- }
- } else {
- // skip unnamed namespaces
- while (owner instanceof ICPPNamespace) {
- char[] name= owner.getNameCharArray();
- if (name.length > 0) {
- break;
- }
- owner= owner.getOwner();
- }
- }
-
- if (owner == null)
- return this;
+ if (binding instanceof IIndexBinding) {
+ IIndexBinding ib= (IIndexBinding) binding;
+ // don't adapt file local bindings from other fragments to this one.
+ if (ib.isFileLocal()) {
+ return null;
+ }
+ } else {
+ // skip unnamed namespaces
+ while (owner instanceof ICPPNamespace) {
+ char[] name= owner.getNameCharArray();
+ if (name.length > 0) {
+ break;
+ }
+ owner= owner.getOwner();
+ }
+ }
+
+ if (owner == null)
+ return this;
- return adaptOrAddBinding(add, owner);
- } catch (DOMException e) {
- throw new CoreException(Util.createStatus(e));
- }
+ return adaptOrAddBinding(add, owner);
}
private PDOMBinding adaptOrAddBinding(boolean add, IBinding binding) throws CoreException {
@@ -864,33 +860,29 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
name = (IASTName) parent;
}
IScope container= CPPVisitor.getContainingScope(name);
- try {
- boolean doit= false;
- PDOMCPPNamespace containerNS= null;
-
- IASTNode node= ASTInternal.getPhysicalNodeOfScope(container);
- if (node instanceof IASTTranslationUnit) {
- doit= true;
- }
- else if (node instanceof ICPPASTNamespaceDefinition) {
- ICPPASTNamespaceDefinition nsDef= (ICPPASTNamespaceDefinition) node;
- IASTName nsContainerName= nsDef.getName();
- if (nsContainerName != null) {
- PDOMBinding binding= adaptBinding(nsContainerName.resolveBinding());
- if (binding instanceof PDOMCPPNamespace) {
- containerNS= (PDOMCPPNamespace) binding;
- doit= true;
- }
+ boolean doit= false;
+ PDOMCPPNamespace containerNS= null;
+
+ IASTNode node= ASTInternal.getPhysicalNodeOfScope(container);
+ if (node instanceof IASTTranslationUnit) {
+ doit= true;
+ }
+ else if (node instanceof ICPPASTNamespaceDefinition) {
+ ICPPASTNamespaceDefinition nsDef= (ICPPASTNamespaceDefinition) node;
+ IASTName nsContainerName= nsDef.getName();
+ if (nsContainerName != null) {
+ PDOMBinding binding= adaptBinding(nsContainerName.resolveBinding());
+ if (binding instanceof PDOMCPPNamespace) {
+ containerNS= (PDOMCPPNamespace) binding;
+ doit= true;
}
}
- if (doit) {
- long rec= file.getLastUsingDirectiveRec();
- PDOMCPPUsingDirective ud= new PDOMCPPUsingDirective(this, rec, containerNS,
- pdomName.getBinding(), pdomName.getFileLocation().getNodeOffset());
- file.setFirstUsingDirectiveRec(ud.getRecord());
- }
- } catch (DOMException e) {
- CCorePlugin.log(e);
+ }
+ if (doit) {
+ long rec= file.getLastUsingDirectiveRec();
+ PDOMCPPUsingDirective ud= new PDOMCPPUsingDirective(this, rec, containerNS,
+ pdomName.getBinding(), pdomName.getFileLocation().getNodeOffset());
+ file.setFirstUsingDirectiveRec(ud.getRecord());
}
} else if (parentNode instanceof ICPPASTElaboratedTypeSpecifier) {
ICPPASTElaboratedTypeSpecifier elaboratedSpecifier = (ICPPASTElaboratedTypeSpecifier)parentNode;
@@ -994,17 +986,14 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
}
}
if (file == null && !(binding instanceof IIndexBinding)) {
- try {
- IBinding owner= binding.getOwner();
- if (owner instanceof ICPPNamespace) {
- if (owner.getNameCharArray().length == 0) {
- String path= ASTInternal.getDeclaredInSourceFileOnly(owner, false, glob);
- if (path != null) {
- file= wpdom.getFileForASTPath(getLinkageID(), path);
- }
+ IBinding owner= binding.getOwner();
+ if (owner instanceof ICPPNamespace) {
+ if (owner.getNameCharArray().length == 0) {
+ String path= ASTInternal.getDeclaredInSourceFileOnly(owner, false, glob);
+ if (path != null) {
+ file= wpdom.getFileForASTPath(getLinkageID(), path);
}
}
- } catch (DOMException e) {
}
}
if (file != null) {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java
index 8817e580a7..8b6e95ecd4 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethod.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 QNX Software Systems and others.
+ * Copyright (c) 2006, 2010 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
@@ -103,7 +103,7 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod {
return IIndexCPPBindingConstants.CPPMETHOD;
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return getBit(getAnnotation1(), PDOMCPPAnnotation.VIRTUAL_OFFSET);
}
@@ -113,7 +113,7 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod {
return annotation1;
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return getBit(getAnnotation1(), PDOMCPPAnnotation.PURE_VIRTUAL_OFFSET);
}
@@ -122,7 +122,7 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod {
}
@Override
- public boolean isMutable() throws DOMException {
+ public boolean isMutable() {
throw new PDOMNotImplementedError();
}
@@ -158,11 +158,11 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod {
return false;
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return PDOMCPPAnnotation.getVisibility(getAnnotation());
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
return (ICPPClassType) getOwner();
}
@@ -210,7 +210,7 @@ class PDOMCPPMethod extends PDOMCPPFunction implements ICPPMethod {
}
@Override
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
if (isImplicit()) {
return ClassTypeHelper.getInheritedExceptionSpecification(this);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodInstance.java
index 4daded16b7..95f32619c9 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodInstance.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
@@ -64,19 +63,19 @@ class PDOMCPPMethodInstance extends PDOMCPPFunctionInstance implements ICPPMetho
return ((ICPPMethod)getTemplateDefinition()).isImplicit();
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return ((ICPPMethod)getTemplateDefinition()).isVirtual();
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return ((ICPPMethod)getTemplateDefinition()).isPureVirtual();
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
return (ICPPClassType) getOwner();
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return ((ICPPMethod)getTemplateDefinition()).getVisibility();
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodSpecialization.java
index f7ae8fc32c..797bccd6a4 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -86,16 +86,16 @@ class PDOMCPPMethodSpecialization extends PDOMCPPFunctionSpecialization
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.IMPLICIT_METHOD_OFFSET);
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.VIRTUAL_OFFSET);
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return getBit(getByte(record + ANNOTATION1), PDOMCPPAnnotation.PURE_VIRTUAL_OFFSET);
}
@Override
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
// ISO/IEC 14882:2003 9.2.6
return false;
}
@@ -105,11 +105,11 @@ class PDOMCPPMethodSpecialization extends PDOMCPPFunctionSpecialization
return false;
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
return (ICPPClassType) getOwner();
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return PDOMCPPAnnotation.getVisibility(getByte(record + ANNOTATION_OFFSET));
}
@@ -124,7 +124,7 @@ class PDOMCPPMethodSpecialization extends PDOMCPPFunctionSpecialization
}
@Override
- public IType[] getExceptionSpecification() throws DOMException {
+ public IType[] getExceptionSpecification() {
if (isImplicit()) {
return ClassTypeHelper.getInheritedExceptionSpecification(this);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplate.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplate.java
index a867040f20..599649a873 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplate.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -93,15 +93,15 @@ class PDOMCPPMethodTemplate extends PDOMCPPFunctionTemplate implements ICPPMetho
return getBit(getAnnotation1(), PDOMCPPAnnotation.IMPLICIT_METHOD_OFFSET);
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
return getBit(getAnnotation1(), PDOMCPPAnnotation.VIRTUAL_OFFSET);
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
return (ICPPClassType) getOwner();
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
return PDOMCPPAnnotation.getVisibility(getAnnotation());
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplateSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplateSpecialization.java
index c7529e96e9..c9bcf33a9c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplateSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPMethodTemplateSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionTemplate;
@@ -59,7 +58,7 @@ class PDOMCPPMethodTemplateSpecialization extends
return false;
}
- public boolean isVirtual() throws DOMException {
+ public boolean isVirtual() {
IBinding spec = getSpecializedBinding();
if (spec instanceof ICPPMethod) {
((ICPPMethod)spec).isVirtual();
@@ -67,11 +66,11 @@ class PDOMCPPMethodTemplateSpecialization extends
return false;
}
- public ICPPClassType getClassOwner() throws DOMException {
+ public ICPPClassType getClassOwner() {
return (ICPPClassType) getOwner();
}
- public int getVisibility() throws DOMException {
+ public int getVisibility() {
IBinding spec = getSpecializedBinding();
if (spec instanceof ICPPMethod) {
((ICPPMethod)spec).getVisibility();
@@ -84,7 +83,7 @@ class PDOMCPPMethodTemplateSpecialization extends
return false;
}
- public boolean isPureVirtual() throws DOMException {
+ public boolean isPureVirtual() {
return false;
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java
index 8e6af112ef..799959c45a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespace.java
@@ -18,7 +18,6 @@ import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.dom.IPDOMVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -162,7 +161,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding
}
@Override
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
try {
IBinding[] bindings= getBindingsViaCache(name.getLookupKey());
if (fileSet != null) {
@@ -176,8 +175,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding
}
@Override
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet)
- throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
IBinding[] result = null;
try {
if (!prefixLookup) {
@@ -217,7 +215,7 @@ class PDOMCPPNamespace extends PDOMCPPBinding
return true;
}
- public IBinding[] getMemberBindings() throws DOMException {
+ public IBinding[] getMemberBindings() {
IBinding[] result = null;
final List<PDOMNode> preresult = new ArrayList<PDOMNode>();
try {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespaceAlias.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespaceAlias.java
index 9395d56768..9f93d1e31b 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespaceAlias.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPNamespaceAlias.java
@@ -13,7 +13,6 @@
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceAlias;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPNamespaceScope;
@@ -69,7 +68,7 @@ class PDOMCPPNamespaceAlias extends PDOMCPPBinding implements ICPPNamespaceAlias
return IIndexCPPBindingConstants.CPPNAMESPACEALIAS;
}
- public ICPPNamespaceScope getNamespaceScope() throws DOMException {
+ public ICPPNamespaceScope getNamespaceScope() {
return getNamespaceScope(this, 20); // avoid an infinite loop.
}
@@ -88,7 +87,7 @@ class PDOMCPPNamespaceAlias extends PDOMCPPBinding implements ICPPNamespaceAlias
return null;
}
- public IBinding[] getMemberBindings() throws DOMException {
+ public IBinding[] getMemberBindings() {
throw new PDOMNotImplementedError();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameter.java
index 4f37726fd5..8705bb7cba 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 QNX Software Systems and others.
+ * Copyright (c) 2006, 2010 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
@@ -67,12 +67,8 @@ class PDOMCPPParameter extends PDOMNamedNode implements ICPPParameter, IPDOMBind
}
private void storeAnnotations(Database db, ICPPParameter param) throws CoreException {
- try {
- byte annotations = PDOMCPPAnnotation.encodeAnnotation(param);
- db.putByte(record + ANNOTATIONS, annotations);
- } catch (DOMException e) {
- // ignore and miss out on some properties of the parameter
- }
+ byte annotations = PDOMCPPAnnotation.encodeAnnotation(param);
+ db.putByte(record + ANNOTATIONS, annotations);
}
public void update(ICPPParameter newPar) throws CoreException {
@@ -113,7 +109,7 @@ class PDOMCPPParameter extends PDOMNamedNode implements ICPPParameter, IPDOMBind
return false;
}
- public boolean isMutable() throws DOMException {
+ public boolean isMutable() {
// ISO/IEC 14882:2003 7.1.1.8
return false;
}
@@ -122,13 +118,13 @@ class PDOMCPPParameter extends PDOMNamedNode implements ICPPParameter, IPDOMBind
return fType;
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
// ISO/IEC 14882:2003 7.1.1.2
byte flag = 1<<PDOMCAnnotation.AUTO_OFFSET;
return hasFlag(flag, true, ANNOTATIONS);
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
// ISO/IEC 14882:2003 7.1.1.5
return false;
}
@@ -137,13 +133,13 @@ class PDOMCPPParameter extends PDOMNamedNode implements ICPPParameter, IPDOMBind
return false;
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
// ISO/IEC 14882:2003 7.1.1.2
byte flag = 1<<PDOMCAnnotation.REGISTER_OFFSET;
return hasFlag(flag, true, ANNOTATIONS);
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
// ISO/IEC 14882:2003 7.1.1.4
return false;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameterSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameterSpecialization.java
index f2a8209a16..d8343400cc 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameterSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPParameterSpecialization.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 QNX Software Systems and others.
+ * Copyright (c) 2007, 2010 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
@@ -116,15 +116,15 @@ class PDOMCPPParameterSpecialization extends PDOMCPPSpecialization implements IC
return getType() instanceof ICPPParameterPackType;
}
- public boolean isAuto() throws DOMException {
+ public boolean isAuto() {
return getParameter().isAuto();
}
- public boolean isRegister() throws DOMException {
+ public boolean isRegister() {
return getParameter().isRegister();
}
- public boolean isExtern() throws DOMException {
+ public boolean isExtern() {
return false;
}
@@ -132,11 +132,11 @@ class PDOMCPPParameterSpecialization extends PDOMCPPSpecialization implements IC
return false;
}
- public boolean isStatic() throws DOMException {
+ public boolean isStatic() {
return false;
}
- public boolean isMutable() throws DOMException {
+ public boolean isMutable() {
return false;
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassInstance.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassInstance.java
index a3f45a15cc..c349e2d771 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassInstance.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassInstance.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Google, Inc and others.
+ * Copyright (c) 2008, 2010 Google, Inc 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.IBinding;
import org.eclipse.cdt.core.dom.ast.IType;
import org.eclipse.cdt.core.dom.ast.ITypedef;
@@ -104,13 +103,10 @@ class PDOMCPPUnknownClassInstance extends PDOMCPPUnknownClassType implements ICP
return false;
}
}
- try {
- final IBinding lhsContainer= getOwner();
- final IBinding rhsContainer= rhs.getOwner();
- if (lhsContainer instanceof IType && rhsContainer instanceof IType) {
- return (((IType) lhsContainer).isSameType((IType) rhsContainer));
- }
- } catch (DOMException e) {
+ final IBinding lhsContainer= getOwner();
+ final IBinding rhsContainer= rhs.getOwner();
+ if (lhsContainer instanceof IType && rhsContainer instanceof IType) {
+ return (((IType) lhsContainer).isSameType((IType) rhsContainer));
}
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassType.java
index 9990e0d030..1239abc4db 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassType.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUnknownClassType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Google, Inc and others.
+ * Copyright (c) 2008, 2010 Google, Inc 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
@@ -12,7 +12,6 @@
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
import org.eclipse.cdt.core.dom.IPDOMVisitor;
-import org.eclipse.cdt.core.dom.ast.DOMException;
import org.eclipse.cdt.core.dom.ast.EScopeKind;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IBinding;
@@ -30,7 +29,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
import org.eclipse.cdt.core.index.IIndexBinding;
import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
-import org.eclipse.cdt.internal.core.Util;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPDeferredClassInstance;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPUnknownClassInstance;
import org.eclipse.cdt.internal.core.dom.parser.cpp.ICPPUnknownClassType;
@@ -82,11 +80,7 @@ class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding implements ICPPClass
}
private void setKind(ICPPClassType ct) throws CoreException {
- try {
- getDB().putByte(record + KEY, (byte) ct.getKey());
- } catch (DOMException e) {
- throw new CoreException(Util.createStatus(e));
- }
+ getDB().putByte(record + KEY, (byte) ct.getKey());
}
@Override
@@ -116,7 +110,7 @@ class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding implements ICPPClass
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;
}
- public IScope getCompositeScope() throws DOMException {
+ public IScope getCompositeScope() {
return this;
}
@@ -137,17 +131,16 @@ class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding implements ICPPClass
}
@Override
- public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) throws DOMException {
+ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet fileSet) {
return null;
}
@Override
- public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet)
- throws DOMException {
+ public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet fileSet) {
return IBinding.EMPTY_BINDING_ARRAY;
}
- public IBinding[] find(String name) throws DOMException {
+ public IBinding[] find(String name) {
return CPPSemantics.findBindings(this, name, false);
}
@@ -155,7 +148,7 @@ class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding implements ICPPClass
@Override
public Object clone() { fail(); return null; }
- public IField findField(String name) throws DOMException { fail(); return null; }
+ public IField findField(String name) { fail(); return null; }
@Override
public boolean mayHaveChildren() {
@@ -247,13 +240,10 @@ class PDOMCPPUnknownClassType extends PDOMCPPUnknownBinding implements ICPPClass
&& type instanceof ICPPDeferredClassInstance == false) {
ICPPUnknownClassType rhs= (ICPPUnknownClassType) type;
if (CharArrayUtils.equals(getNameCharArray(), rhs.getNameCharArray())) {
- try {
- final IBinding lhsContainer = getOwner();
- final IBinding rhsContainer = rhs.getOwner();
- if (lhsContainer instanceof IType && rhsContainer instanceof IType) {
- return ((IType)lhsContainer).isSameType((IType) rhsContainer);
- }
- } catch (DOMException e) {
+ final IBinding lhsContainer = getOwner();
+ final IBinding rhsContainer = rhs.getOwner();
+ if (lhsContainer instanceof IType && rhsContainer instanceof IType) {
+ return ((IType)lhsContainer).isSameType((IType) rhsContainer);
}
}
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDirective.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDirective.java
index 844b75a7d9..0e3b9ff9c1 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPUsingDirective.ja