mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
some annotations in code
This commit is contained in:
+6
-6
@@ -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);
|
||||
|
||||
+3
-2
@@ -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();
|
||||
|
||||
}
|
||||
+3
-1
@@ -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();
|
||||
|
||||
}
|
||||
+2
-1
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user