1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 05:15:43 +02:00

Fixed ClassCastException in CompleteParseASTTest.

This commit is contained in:
John Camelon 2004-06-17 17:29:12 +00:00
parent 6f1acede84
commit 67ad3bb4b0

View file

@ -516,7 +516,9 @@ public class CompleteParseBaseTest extends TestCase
protected CodeScope getCurrentCodeScope() protected CodeScope getCurrentCodeScope()
{ {
if( scopes.peek() instanceof CodeScope )
return (CodeScope)scopes.peek(); return (CodeScope)scopes.peek();
return null;
} }
protected Scope popScope() protected Scope popScope()
@ -714,6 +716,7 @@ public class CompleteParseBaseTest extends TestCase
*/ */
public void exitCodeBlock(IASTCodeScope scope) { public void exitCodeBlock(IASTCodeScope scope) {
popScope(); popScope();
if( getCurrentCodeScope() != null )
getCurrentCodeScope().addNewScope(scope); getCurrentCodeScope().addNewScope(scope);
} }