Buggy code:
; private CompilationUnit compilationUnit ; private SourceUnit source ; private VariableScope currentScope ; private boolean isTopLevelProperty = true ; private boolean inPropertyExpression = false ; private boolean inClosure = false ; private Map < String , GenericsType > genericParameterNames = new HashMap < String , GenericsType > ( ) ; private Set < FieldNode > fieldTypesChecked = new HashSet < FieldNode > ( ) ; private boolean checkingVariableTypeInDeclaration = false ; private ImportNode currImportNode = null ; private MethodNode currentMethod ; private ClassNodeResolver classNodeResolver ; private static class ConstructedClassWithPackage extends ClassNode { String prefix ; String className ; public ConstructedClassWithPackage ( String pkg , String name ) { } public String getName ( ) { } public boolean hasPackageName ( ) { } public String setName ( String name ) { } } private static class LowerCaseClass extends ClassNode { String className ; public LowerCaseClass ( String name ) { } public String getName ( ) { } public boolean hasPackageName ( ) { } public String setName ( String name ) { } } public ResolveVisitor ( CompilationUnit cu ) { } public void startResolving ( ClassNode node , SourceUnit source ) { } protected void visitConstructorOrMethod ( MethodNode node , boolean isConstructor ) { } public void visitField ( FieldNode node ) { } public void visitProperty ( PropertyNode node ) { } private boolean resolveToInner ( ClassNode type ) { } private boolean resolveToInnerEnum ( ClassNode type ) { } private void resolveOrFail ( ClassNode type , String msg , ASTNode node ) { } private void resolveOrFail ( ClassNode type , ASTNode node , boolean prefereImports ) { } private void resolveOrFail ( ClassNode type , ASTNode node ) { } private boolean resolve ( ClassNode type ) { } private boolean resolve ( ClassNode type , boolean testModuleImports , boolean testDefaultImports , boolean testStaticInnerClasses ) { } private boolean resolveNestedClass ( ClassNode type ) { } private String replaceLastPoint ( String name ) { } private boolean resolveFromStaticInnerClasses ( ClassNode type , boolean testStaticInnerClasses ) { } private boolean resolveFromDefaultImports ( ClassNode type , boolean testDefaultImports ) { } private boolean resolveFromCompileUnit ( ClassNode type ) { } private void ambiguousClass ( ClassNode type , ClassNode iType , String name ) { } private boolean resolveAliasFromModule ( ClassNode type ) { } private boolean resolveFromModule ( ClassNode type , boolean testModuleImports ) { } private boolean resolveToOuter ( ClassNode type ) { } public Expression transform ( Expression exp ) { } private String lookupClassName ( PropertyExpression pe ) { } private Expression correctClassClassChain ( PropertyExpression pe ) { } protected Expression transformPropertyExpression ( PropertyExpression pe ) { } private boolean directlyImplementsTrait ( ClassNode trait ) { } private void checkThisAndSuperAsPropertyAccess ( PropertyExpression expression ) { if ( expression . isImplicitThis ( ) ) return ; String prop = expression . getPropertyAsString ( ) ; if ( prop == null ) return ; if ( ( ! ( prop . equals ( "this" ) ) ) && ( ! ( prop . equals ( "super" ) ) ) ) return ; ClassNode type = expression . getObjectExpression ( ) . getType ( ) ; if ( ( expression . getObjectExpression ( ) ) instanceof ClassExpression ) { if ( ( ! ( ( currentClass ) instanceof InnerClassNode ) ) && ( ! ( Traits . isTrait ( type ) ) ) ) { addError ( "The<seq2seq4repair_space>usage<seq2seq4repair_space>of<seq2seq4repair_space>'Class.this'<seq2seq4repair_space>and<seq2seq4repair_space>'Class.super'<seq2seq4repair_space>is<seq2seq4repair_space>only<seq2seq4repair_space>allowed<seq2seq4repair_space>in<seq2seq4repair_space>nested//inner<seq2seq4repair_space>classes." , expression ) ; return ; } if ( ( ( ( ! ( currentScope . isInStaticContext ( ) ) ) && ( Traits . isTrait ( type ) ) ) && ( "super" . equals ( prop ) ) ) && ( directlyImplementsTrait ( type ) ) ) { return ; } ClassNode iterType = currentClass ; while ( iterType != null ) { if ( iterType . equals ( type ) ) break ; iterType = iterType . getOuterClass ( ) ; } if ( iterType == null ) { addError ( ( ( ( ( "The<seq2seq4repair_space>class<seq2seq4repair_space>'" + ( type . getName ( ) ) ) + "'<seq2seq4repair_space>needs<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>an<seq2seq4repair_space>outer<seq2seq4repair_space>class<seq2seq4repair_space>of<seq2seq4repair_space>'" ) + ( currentClass . getName ( ) ) ) + "'<seq2seq4repair_space>when<seq2seq4repair_space>using<seq2seq4repair_space>'.this'<seq2seq4repair_space>or<seq2seq4repair_space>'.super'." ) , expression ) ; } if ( ( ( currentClass . getModifiers ( ) ) & ( Opcodes . ACC_STATIC ) ) == 0 ) return ; <START_BUG> if ( ! ( currentScope . isInStaticContext ( ) ) ) <END_BUG> return ; addError ( ( ( "The<seq2seq4repair_space>usage<seq2seq4repair_space>of<seq2seq4repair_space>'Class.this'<seq2seq4repair_space>and<seq2seq4repair_space>'Class.super'<seq2seq4repair_space>within<seq2seq4repair_space>static<seq2seq4repair_space>nested<seq2seq4repair_space>class<seq2seq4repair_space>'" + ( currentClass . getName ( ) ) ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>allowed<seq2seq4repair_space>in<seq2seq4repair_space>a<seq2seq4repair_space>static<seq2seq4repair_space>context." ) , expression ) ; } } protected Expression transformVariableExpression ( VariableExpression ve ) { } private boolean testVanillaNameForClass ( String name ) { } private boolean isLeftSquareBracket ( int op ) { } protected Expression transformBinaryExpression ( BinaryExpression be ) { } protected Expression transformClosureExpression ( ClosureExpression ce ) { } protected Expression transformConstructorCallExpression ( ConstructorCallExpression cce ) { } private String getDescription ( ClassNode node ) { } protected Expression transformMethodCallExpression ( MethodCallExpression mce ) { } protected Expression transformDeclarationExpression ( DeclarationExpression de ) { } private void fixDeclaringClass ( DeclarationExpression newDeclExpr ) { } protected Expression transformAnnotationConstantExpression ( AnnotationConstantExpression ace ) { } public void visitAnnotations ( AnnotatedNode node ) { } private Expression transformInlineConstants ( Expression exp ) { } private void checkAnnotationMemberValue ( Expression newValue ) { } public void visitClass ( ClassNode node ) { } private void checkCyclicInheritence ( ClassNode originalNode , ClassNode parentToCompare , ClassNode [ ] interfacesToCompare ) { } public void visitCatchStatement ( CatchStatement cs ) { } public void visitForLoop ( ForStatement forLoop ) { } public void visitBlockStatement ( BlockStatement block ) { } protected SourceUnit getSourceUnit ( ) { } private boolean resolveGenericsTypes ( GenericsType [ ] types ) { } private void resolveGenericsHeader ( GenericsType [ ] types ) { } private boolean resolveGenericsType ( GenericsType genericsType ) { } public void setClassNodeResolver ( ClassNodeResolver classNodeResolver ) { } }

Fix:
if ( ( ( currentScope ) != null ) && ( ! ( currentScope . isInStaticContext ( ) ) ) )