some annotations in code

This commit is contained in:
Maxim Medvedev
2011-04-08 12:18:48 +04:00
parent 7eaffc2742
commit 76ee833791
4 changed files with 14 additions and 10 deletions
@@ -56,21 +56,21 @@ public class TryCatchStatement implements GroovyElementTypes {
parseHandlers(builder, parser);
}
if (kFINALLY.equals(builder.getTokenType()) |
ParserUtils.lookAhead(builder,mNLS, kFINALLY)) {
if (kFINALLY.equals(builder.getTokenType()) || ParserUtils.lookAhead(builder, mNLS, kFINALLY)) {
ParserUtils.getToken(builder, mNLS);
PsiBuilder.Marker finallyMarker = builder.mark();
warn = builder.mark();
ParserUtils.getToken(builder, kFINALLY);
ParserUtils.getToken(builder, mNLS);
if (!mLCURLY.equals(builder.getTokenType()) || !OpenOrClosableBlock.parseOpenBlock(builder, parser)) {
if (mLCURLY.equals(builder.getTokenType()) && OpenOrClosableBlock.parseOpenBlock(builder, parser)) {
warn.drop();
finallyMarker.done(FINALLY_CLAUSE);
}
else {
finallyMarker.drop();
warn.rollbackTo();
builder.error(GroovyBundle.message("expression.expected"));
} else {
warn.drop();
finallyMarker.done(FINALLY_CLAUSE);
}
}
marker.done(TRY_BLOCK_STATEMENT);
@@ -12,8 +12,9 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
public interface GrCatchClause extends GrParametersOwner {
@Nullable
public GrParameter getParameter();
GrParameter getParameter();
public GrOpenBlock getBody();
@Nullable
GrOpenBlock getBody();
}
@@ -1,6 +1,7 @@
package org.jetbrains.plugins.groovy.lang.psi.api.statements;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElement;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrOpenBlock;
@@ -10,6 +11,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrOpenBlock;
*/
public interface GrFinallyClause extends GroovyPsiElement {
public GrOpenBlock getBody();
@NotNull
GrOpenBlock getBody();
}
@@ -38,8 +38,9 @@ public class GrFinallyClauseImpl extends GroovyPsiElementImpl implements GrFinal
return "Finally clause";
}
@NotNull
public GrOpenBlock getBody() {
return findChildByClass(GrOpenBlock.class);
return findNotNullChildByClass(GrOpenBlock.class);
}
}