1 2 29 package com.puppycrawl.tools.checkstyle.checks.usage.transmogrify; 30 31 32 33 34 public class AnonymousInnerClass extends ClassDef { 35 36 protected SymTabAST _objblock; 37 protected SymTabAST _classExtended; 38 39 public AnonymousInnerClass(SymTabAST objblock, 40 SymTabAST classExtended, 41 Scope parentScope) { 42 super(parentScope.getName() + "$" + parentScope.getEnclosingClass().getNextAnonymousId(), 43 parentScope, 44 objblock); 45 46 _objblock = objblock; 47 _classExtended = classExtended; 48 } 49 50 public void finishMakingDefinition() { 51 if (_classExtended != null) { 52 String extendedClassName = ASTUtil.constructDottedName(_classExtended); 53 IClass superclass = getClassDefinition(extendedClassName); 54 55 if (superclass != null) { 56 setSuperclass(superclass); 57 superclass.addSubclass(this); 58 } 59 } 60 } 61 62 } 63 | Popular Tags |