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:
parent
6f1acede84
commit
67ad3bb4b0
1 changed files with 5 additions and 2 deletions
|
@ -516,7 +516,9 @@ public class CompleteParseBaseTest extends TestCase
|
||||||
|
|
||||||
protected CodeScope getCurrentCodeScope()
|
protected CodeScope getCurrentCodeScope()
|
||||||
{
|
{
|
||||||
return (CodeScope)scopes.peek();
|
if( scopes.peek() instanceof CodeScope )
|
||||||
|
return (CodeScope)scopes.peek();
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Scope popScope()
|
protected Scope popScope()
|
||||||
|
@ -714,7 +716,8 @@ public class CompleteParseBaseTest extends TestCase
|
||||||
*/
|
*/
|
||||||
public void exitCodeBlock(IASTCodeScope scope) {
|
public void exitCodeBlock(IASTCodeScope scope) {
|
||||||
popScope();
|
popScope();
|
||||||
getCurrentCodeScope().addNewScope(scope);
|
if( getCurrentCodeScope() != null )
|
||||||
|
getCurrentCodeScope().addNewScope(scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
Loading…
Add table
Reference in a new issue