localNames = oldLocalNames;
}
@Override
public void visit(Tree.AttributeDeclaration that) {
Value model = that.getDeclarationModel();
/*
* we need a prefix to local type qualifiers for values in toplevel attributes
* so that we can make a difference between qualifiers for:
*
* Anything() toplevel1 = void(){ class Local(){} }
* Anything() toplevel2 = void(){ class Local(){} }
*
* Since both local types have the same name and the same package container at runtime,
* and there's no proper ordering in a package, so we use 1toplevel1$ as a prefix. It
* starts with a number because there's heuristics in the runtime model that local types
* must start with a number.
*/
if(model != null && model.isToplevel()){
Map<String,Integer> oldLocalNames = localNames;
String oldPrefix = prefix;
localNames = new HashMap<String,Integer>();
prefix = "1"+model.getName()+"$";
super.visit(that);
localNames = oldLocalNames;
prefix = oldPrefix;