Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJohn Camelon2004-10-05 14:16:06 -0400
committerJohn Camelon2004-10-05 14:16:06 -0400
commit5bd3694555666c967f03e1bdd1b5cf43c89e5f15 (patch)
tree144fa65b9d148dd333487e9d72a0743eeea08061 /core
parent95b192460ced9a80ff5aed88f35e086314d348ab (diff)
downloadorg.eclipse.cdt-5bd3694555666c967f03e1bdd1b5cf43c89e5f15.tar.gz
org.eclipse.cdt-5bd3694555666c967f03e1bdd1b5cf43c89e5f15.tar.xz
org.eclipse.cdt-5bd3694555666c967f03e1bdd1b5cf43c89e5f15.zip
Fixed 75338 - [Parser] complete.ASTExceptionSpecification#getTypeIds() yields useless information
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java17
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java2
2 files changed, 18 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java
index b46019c27a9..ea1ce74af1a 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java
@@ -27,6 +27,7 @@ import org.eclipse.cdt.core.parser.ast.IASTCodeScope;
import org.eclipse.cdt.core.parser.ast.IASTElaboratedTypeSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerationSpecifier;
import org.eclipse.cdt.core.parser.ast.IASTEnumerator;
+import org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification;
import org.eclipse.cdt.core.parser.ast.IASTField;
import org.eclipse.cdt.core.parser.ast.IASTFunction;
import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification;
@@ -2224,5 +2225,21 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
assertTrue( floatPow.hasFunctionBody() );
}
+ public void testBug75338() throws Exception
+ {
+ Writer writer = new StringWriter();
+ writer.write( "class Thrown { };\n");
+ writer.write( "void foo() throw( Thrown );");
+ Iterator i = (Iterator) parse( writer.toString() ).getDeclarations();
+ assertTrue( i.next() instanceof IASTAbstractTypeSpecifierDeclaration );
+ IASTFunction foo = (IASTFunction) i.next();
+ assertFalse( i.hasNext() );
+ IASTExceptionSpecification exSpec = foo.getExceptionSpec();
+ assertNotNull( exSpec );
+ Iterator typeIds = exSpec.getTypeIds();
+ assertTrue( typeIds.hasNext() );
+ IASTTypeId typeId = (IASTTypeId) typeIds.next();
+ assertEquals( typeId.getTypeOrClassName(), "Thrown" );
+ }
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java
index b22aed04a7b..e684a568f45 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java
@@ -1881,7 +1881,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
{
int size = typeIds.size();
for( int i = 0; i < size; i++ )
- newTypeIds.add( ((IASTTypeId)typeIds.get(i)).toString() );
+ newTypeIds.add( typeIds.get(i) );
}
return new ASTExceptionSpecification( newTypeIds );

Back to the top