All Downloads are FREE. Search and download functionalities are using the official Maven repository.

soot.JastAddJ.ClassDeclSubstituted Maven / Gradle / Ivy

There is a newer version: 4.6.0
Show newest version
/* This file was generated with JastAdd2 (http://jastadd.org) version R20130212 (r1031) */
package soot.JastAddJ;

import java.util.HashSet;
import java.io.File;
import java.util.*;
import beaver.*;
import java.util.ArrayList;
import java.util.zip.*;
import java.io.*;
import java.io.FileNotFoundException;
import java.util.Collection;
import soot.*;
import soot.util.*;
import soot.jimple.*;
import soot.coffi.ClassFile;
import soot.coffi.method_info;
import soot.coffi.CONSTANT_Utf8_info;
import soot.tagkit.SourceFileTag;
import soot.coffi.CoffiMethodSource;

/**
 * @production ClassDeclSubstituted : {@link ClassDecl} ::= <Original:TypeDecl> {@link BodyDecl}*;
 * @ast node
 * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.ast:41
 */
public class ClassDeclSubstituted extends ClassDecl implements Cloneable, MemberSubstitutor {
  /**
   * @apilevel low-level
   */
  public void flushCache() {
    super.flushCache();
    getBodyDeclList_computed = false;
    getBodyDeclList_value = null;
    sourceTypeDecl_computed = false;
    sourceTypeDecl_value = null;
    instanceOf_TypeDecl_values = null;
    subtype_TypeDecl_values = null;
    localMethodsSignatureMap_computed = false;
    localMethodsSignatureMap_value = null;
    localFields_String_values = null;
    localTypeDecls_String_values = null;
    constructors_computed = false;
    constructors_value = null;
  }
  /**
   * @apilevel internal
   */
  public void flushCollectionCache() {
    super.flushCollectionCache();
  }
  /**
   * @apilevel internal
   */
  @SuppressWarnings({"unchecked", "cast"})
  public ClassDeclSubstituted clone() throws CloneNotSupportedException {
    ClassDeclSubstituted node = (ClassDeclSubstituted)super.clone();
    node.getBodyDeclList_computed = false;
    node.getBodyDeclList_value = null;
    node.sourceTypeDecl_computed = false;
    node.sourceTypeDecl_value = null;
    node.instanceOf_TypeDecl_values = null;
    node.subtype_TypeDecl_values = null;
    node.localMethodsSignatureMap_computed = false;
    node.localMethodsSignatureMap_value = null;
    node.localFields_String_values = null;
    node.localTypeDecls_String_values = null;
    node.constructors_computed = false;
    node.constructors_value = null;
    node.in$Circle(false);
    node.is$Final(false);
    return node;
  }
  /**
   * @apilevel internal
   */
  @SuppressWarnings({"unchecked", "cast"})
  public ClassDeclSubstituted copy() {
    try {
      ClassDeclSubstituted node = (ClassDeclSubstituted) clone();
      node.parent = null;
      if(children != null)
        node.children = (ASTNode[]) children.clone();
      return node;
    } catch (CloneNotSupportedException e) {
      throw new Error("Error: clone not supported for " +
        getClass().getName());
    }
  }
  /**
   * Create a deep copy of the AST subtree at this node.
   * The copy is dangling, i.e. has no parent.
   * @return dangling copy of the subtree at this node
   * @apilevel low-level
   */
  @SuppressWarnings({"unchecked", "cast"})
  public ClassDeclSubstituted fullCopy() {
    ClassDeclSubstituted tree = (ClassDeclSubstituted) copy();
    if (children != null) {
      for (int i = 0; i < children.length; ++i) {
          switch (i) {
          case 5:
            tree.children[i] = new List();
            continue;
          }
        ASTNode child = (ASTNode) children[i];
        if(child != null) {
          child = child.fullCopy();
          tree.setChild(child, i);
        }
      }
    }
    return tree;
  }
  /**
   * @ast method 
   * 
   */
  public ClassDeclSubstituted() {
    super();


  }
  /**
   * Initializes the child array to the correct size.
   * Initializes List and Opt nta children.
   * @apilevel internal
   * @ast method
   * @ast method 
   * 
   */
  public void init$Children() {
    children = new ASTNode[4];
    setChild(new Opt(), 1);
    setChild(new List(), 2);
    setChild(new List(), 3);
  }
  /**
   * @ast method 
   * 
   */
  public ClassDeclSubstituted(Modifiers p0, String p1, Opt p2, List p3, TypeDecl p4) {
    setChild(p0, 0);
    setID(p1);
    setChild(p2, 1);
    setChild(p3, 2);
    setOriginal(p4);
  }
  /**
   * @ast method 
   * 
   */
  public ClassDeclSubstituted(Modifiers p0, beaver.Symbol p1, Opt p2, List p3, TypeDecl p4) {
    setChild(p0, 0);
    setID(p1);
    setChild(p2, 1);
    setChild(p3, 2);
    setOriginal(p4);
  }
  /**
   * @apilevel low-level
   * @ast method 
   * 
   */
  protected int numChildren() {
    return 3;
  }
  /**
   * @apilevel internal
   * @ast method 
   * 
   */
  public boolean mayHaveRewrite() {
    return false;
  }
  /**
   * Replaces the Modifiers child.
   * @param node The new node to replace the Modifiers child.
   * @apilevel high-level
   * @ast method 
   * 
   */
  public void setModifiers(Modifiers node) {
    setChild(node, 0);
  }
  /**
   * Retrieves the Modifiers child.
   * @return The current node used as the Modifiers child.
   * @apilevel high-level
   * @ast method 
   * 
   */
  public Modifiers getModifiers() {
    return (Modifiers)getChild(0);
  }
  /**
   * Retrieves the Modifiers child.
   * 

This method does not invoke AST transformations.

* @return The current node used as the Modifiers child. * @apilevel low-level * @ast method * */ public Modifiers getModifiersNoTransform() { return (Modifiers)getChildNoTransform(0); } /** * Replaces the lexeme ID. * @param value The new value for the lexeme ID. * @apilevel high-level * @ast method * */ public void setID(String value) { tokenString_ID = value; } /** * JastAdd-internal setter for lexeme ID using the Beaver parser. * @apilevel internal * @ast method * */ public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } /** * Retrieves the value for the lexeme ID. * @return The value for the lexeme ID. * @apilevel high-level * @ast method * */ public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } /** * Replaces the optional node for the SuperClassAccess child. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child! * @param opt The new node to be used as the optional node for the SuperClassAccess child. * @apilevel low-level * @ast method * */ public void setSuperClassAccessOpt(Opt opt) { setChild(opt, 1); } /** * Check whether the optional SuperClassAccess child exists. * @return {@code true} if the optional SuperClassAccess child exists, {@code false} if it does not. * @apilevel high-level * @ast method * */ public boolean hasSuperClassAccess() { return getSuperClassAccessOpt().getNumChild() != 0; } /** * Retrieves the (optional) SuperClassAccess child. * @return The SuperClassAccess child, if it exists. Returns {@code null} otherwise. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Access getSuperClassAccess() { return (Access)getSuperClassAccessOpt().getChild(0); } /** * Replaces the (optional) SuperClassAccess child. * @param node The new node to be used as the SuperClassAccess child. * @apilevel high-level * @ast method * */ public void setSuperClassAccess(Access node) { getSuperClassAccessOpt().setChild(node, 0); } /** * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt getSuperClassAccessOpt() { return (Opt)getChild(1); } /** * Retrieves the optional node for child SuperClassAccess. This is the {@code Opt} node containing the child SuperClassAccess, not the actual child! *

This method does not invoke AST transformations.

* @return The optional node for child SuperClassAccess. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Opt getSuperClassAccessOptNoTransform() { return (Opt)getChildNoTransform(1); } /** * Replaces the Implements list. * @param list The new list node to be used as the Implements list. * @apilevel high-level * @ast method * */ public void setImplementsList(List list) { setChild(list, 2); } /** * Retrieves the number of children in the Implements list. * @return Number of children in the Implements list. * @apilevel high-level * @ast method * */ public int getNumImplements() { return getImplementsList().getNumChild(); } /** * Retrieves the number of children in the Implements list. * Calling this method will not trigger rewrites.. * @return Number of children in the Implements list. * @apilevel low-level * @ast method * */ public int getNumImplementsNoTransform() { return getImplementsListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the Implements list.. * @param i Index of the element to return. * @return The element at position {@code i} in the Implements list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public Access getImplements(int i) { return (Access)getImplementsList().getChild(i); } /** * Append an element to the Implements list. * @param node The element to append to the Implements list. * @apilevel high-level * @ast method * */ public void addImplements(Access node) { List list = (parent == null || state == null) ? getImplementsListNoTransform() : getImplementsList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addImplementsNoTransform(Access node) { List list = getImplementsListNoTransform(); list.addChild(node); } /** * Replaces the Implements list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setImplements(Access node, int i) { List list = getImplementsList(); list.setChild(node, i); } /** * Retrieves the Implements list. * @return The node representing the Implements list. * @apilevel high-level * @ast method * */ public List getImplementss() { return getImplementsList(); } /** * Retrieves the Implements list. *

This method does not invoke AST transformations.

* @return The node representing the Implements list. * @apilevel low-level * @ast method * */ public List getImplementssNoTransform() { return getImplementsListNoTransform(); } /** * Retrieves the Implements list. * @return The node representing the Implements list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List getImplementsList() { List list = (List)getChild(2); list.getNumChild(); return list; } /** * Retrieves the Implements list. *

This method does not invoke AST transformations.

* @return The node representing the Implements list. * @apilevel low-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public List getImplementsListNoTransform() { return (List)getChildNoTransform(2); } /** * Replaces the lexeme Original. * @param value The new value for the lexeme Original. * @apilevel high-level * @ast method * */ public void setOriginal(TypeDecl value) { tokenTypeDecl_Original = value; } /** * @apilevel internal * @ast method * */ /** * @apilevel internal */ protected TypeDecl tokenTypeDecl_Original; /** * Retrieves the value for the lexeme Original. * @return The value for the lexeme Original. * @apilevel high-level * @ast method * */ public TypeDecl getOriginal() { return tokenTypeDecl_Original; } /** * Replaces the BodyDecl list. * @param list The new list node to be used as the BodyDecl list. * @apilevel high-level * @ast method * */ public void setBodyDeclList(List list) { setChild(list, 3); } /** * Retrieves the number of children in the BodyDecl list. * @return Number of children in the BodyDecl list. * @apilevel high-level * @ast method * */ public int getNumBodyDecl() { return getBodyDeclList().getNumChild(); } /** * Retrieves the number of children in the BodyDecl list. * Calling this method will not trigger rewrites.. * @return Number of children in the BodyDecl list. * @apilevel low-level * @ast method * */ public int getNumBodyDeclNoTransform() { return getBodyDeclListNoTransform().getNumChildNoTransform(); } /** * Retrieves the element at index {@code i} in the BodyDecl list.. * @param i Index of the element to return. * @return The element at position {@code i} in the BodyDecl list. * @apilevel high-level * @ast method * */ @SuppressWarnings({"unchecked", "cast"}) public BodyDecl getBodyDecl(int i) { return (BodyDecl)getBodyDeclList().getChild(i); } /** * Append an element to the BodyDecl list. * @param node The element to append to the BodyDecl list. * @apilevel high-level * @ast method * */ public void addBodyDecl(BodyDecl node) { List list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); list.addChild(node); } /** * @apilevel low-level * @ast method * */ public void addBodyDeclNoTransform(BodyDecl node) { List list = getBodyDeclListNoTransform(); list.addChild(node); } /** * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}. * @param node The new node to replace the old list element. * @param i The list index of the node to be replaced. * @apilevel high-level * @ast method * */ public void setBodyDecl(BodyDecl node, int i) { List list = getBodyDeclList(); list.setChild(node, i); } /** * Retrieves the BodyDecl list. * @return The node representing the BodyDecl list. * @apilevel high-level * @ast method * */ public List getBodyDecls() { return getBodyDeclList(); } /** * Retrieves the BodyDecl list. *

This method does not invoke AST transformations.

* @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ public List getBodyDeclsNoTransform() { return getBodyDeclListNoTransform(); } /** * Retrieves the BodyDecl list. *

This method does not invoke AST transformations.

* @return The node representing the BodyDecl list. * @apilevel low-level * @ast method * */ public List getBodyDeclListNoTransform() { return (List)getChildNoTransform(3); } /** * Retrieves the child position of the BodyDecl list. * @return The the child position of the BodyDecl list. * @apilevel low-level * @ast method * */ protected int getBodyDeclListChildPosition() { return 3; } /** * @attribute syn * @aspect NestedTypes * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:569 */ public TypeDecl hostType() { ASTNode$State state = state(); try { return getOriginal(); } finally { } } /** * @apilevel internal */ protected boolean getBodyDeclList_computed = false; /** * @apilevel internal */ protected List getBodyDeclList_value; /** * @attribute syn nta * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1050 */ @SuppressWarnings({"unchecked", "cast"}) public List getBodyDeclList() { if(getBodyDeclList_computed) { return (List) getChild(getBodyDeclListChildPosition()); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); getBodyDeclList_value = getBodyDeclList_compute(); setBodyDeclList(getBodyDeclList_value); if(isFinal && num == state().boundariesCrossed) getBodyDeclList_computed = true; return (List) getChild(getBodyDeclListChildPosition()); } /** * @apilevel internal */ private List getBodyDeclList_compute() { return new BodyDeclList(); } /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1306 */ public TypeDecl original() { ASTNode$State state = state(); try { return getOriginal().original(); } finally { } } /** * @apilevel internal */ protected boolean sourceTypeDecl_computed = false; /** * @apilevel internal */ protected TypeDecl sourceTypeDecl_value; /** * @attribute syn * @aspect SourceDeclarations * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1506 */ @SuppressWarnings({"unchecked", "cast"}) public TypeDecl sourceTypeDecl() { if(sourceTypeDecl_computed) { return sourceTypeDecl_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); sourceTypeDecl_value = sourceTypeDecl_compute(); if(isFinal && num == state().boundariesCrossed) sourceTypeDecl_computed = true; return sourceTypeDecl_value; } /** * @apilevel internal */ private TypeDecl sourceTypeDecl_compute() { return original().sourceTypeDecl(); } protected java.util.Map instanceOf_TypeDecl_values; /** * @attribute syn * @aspect GenericsSubtype * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:486 */ @SuppressWarnings({"unchecked", "cast"}) public boolean instanceOf(TypeDecl type) { Object _parameters = type; if(instanceOf_TypeDecl_values == null) instanceOf_TypeDecl_values = new java.util.HashMap(4); if(instanceOf_TypeDecl_values.containsKey(_parameters)) { return ((Boolean)instanceOf_TypeDecl_values.get(_parameters)).booleanValue(); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean instanceOf_TypeDecl_value = instanceOf_compute(type); if(isFinal && num == state().boundariesCrossed) instanceOf_TypeDecl_values.put(_parameters, Boolean.valueOf(instanceOf_TypeDecl_value)); return instanceOf_TypeDecl_value; } /** * @apilevel internal */ private boolean instanceOf_compute(TypeDecl type) { return subtype(type); } protected java.util.Map subtype_TypeDecl_values; /** * @attribute syn * @aspect GenericsSubtype * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:491 */ @SuppressWarnings({"unchecked", "cast"}) public boolean subtype(TypeDecl type) { Object _parameters = type; if(subtype_TypeDecl_values == null) subtype_TypeDecl_values = new java.util.HashMap(4); ASTNode$State.CircularValue _value; if(subtype_TypeDecl_values.containsKey(_parameters)) { Object _o = subtype_TypeDecl_values.get(_parameters); if(!(_o instanceof ASTNode$State.CircularValue)) { return ((Boolean)_o).booleanValue(); } else _value = (ASTNode$State.CircularValue)_o; } else { _value = new ASTNode$State.CircularValue(); subtype_TypeDecl_values.put(_parameters, _value); _value.value = Boolean.valueOf(true); } ASTNode$State state = state(); if (!state.IN_CIRCLE) { state.IN_CIRCLE = true; int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); boolean new_subtype_TypeDecl_value; do { _value.visited = new Integer(state.CIRCLE_INDEX); state.CHANGE = false; new_subtype_TypeDecl_value = subtype_compute(type); if (new_subtype_TypeDecl_value!=((Boolean)_value.value).booleanValue()) { state.CHANGE = true; _value.value = Boolean.valueOf(new_subtype_TypeDecl_value); } state.CIRCLE_INDEX++; } while (state.CHANGE); if(isFinal && num == state().boundariesCrossed) { subtype_TypeDecl_values.put(_parameters, new_subtype_TypeDecl_value); } else { subtype_TypeDecl_values.remove(_parameters); state.RESET_CYCLE = true; subtype_compute(type); state.RESET_CYCLE = false; } state.IN_CIRCLE = false; return new_subtype_TypeDecl_value; } if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) { _value.visited = new Integer(state.CIRCLE_INDEX); boolean new_subtype_TypeDecl_value = subtype_compute(type); if (state.RESET_CYCLE) { subtype_TypeDecl_values.remove(_parameters); } else if (new_subtype_TypeDecl_value!=((Boolean)_value.value).booleanValue()) { state.CHANGE = true; _value.value = new_subtype_TypeDecl_value; } return new_subtype_TypeDecl_value; } return ((Boolean)_value.value).booleanValue(); } /** * @apilevel internal */ private boolean subtype_compute(TypeDecl type) { return type.supertypeClassDeclSubstituted(this); } /** * @attribute syn * @aspect GenericsSubtype * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:493 */ public boolean supertypeClassDeclSubstituted(ClassDeclSubstituted type) { ASTNode$State state = state(); try { return original() == type.original() && type.enclosingType().subtype(enclosingType()) || super.supertypeClassDeclSubstituted(type); } finally { } } /** * @attribute syn * @aspect GenericsSubtype * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:421 */ public boolean supertypeClassDecl(ClassDecl type) { ASTNode$State state = state(); try { return super.supertypeClassDecl(type) || original().supertypeClassDecl(type); } finally { } } /** * @apilevel internal */ protected boolean localMethodsSignatureMap_computed = false; /** * @apilevel internal */ protected HashMap localMethodsSignatureMap_value; /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1084 */ @SuppressWarnings({"unchecked", "cast"}) public HashMap localMethodsSignatureMap() { if(localMethodsSignatureMap_computed) { return localMethodsSignatureMap_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); localMethodsSignatureMap_value = localMethodsSignatureMap_compute(); if(true) localMethodsSignatureMap_computed = true; return localMethodsSignatureMap_value; } /** * @apilevel internal */ private HashMap localMethodsSignatureMap_compute() { HashMap map = new HashMap(); for(Iterator iter = original().localMethodsIterator(); iter.hasNext(); ) { MethodDecl decl = (MethodDecl)iter.next(); /* ES removing this: if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) { BodyDecl b = decl.substitutedBodyDecl(this); addBodyDecl(b); // Here we should access b through an ordinary // child accessor instead of setting is$Final directly, // however doing so appears to cause unexpected behaviour! b.is$Final = true; decl = (MethodDecl) b; } map.put(decl.signature(), decl); * and replacing with: */ if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) { BodyDecl copyDecl = ((BodyDeclList)getBodyDeclList()).localMethodSignatureCopy(decl, this); decl = (MethodDecl) copyDecl; } map.put(decl.signature(), decl); } return map; } protected java.util.Map localFields_String_values; /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1119 */ @SuppressWarnings({"unchecked", "cast"}) public SimpleSet localFields(String name) { Object _parameters = name; if(localFields_String_values == null) localFields_String_values = new java.util.HashMap(4); if(localFields_String_values.containsKey(_parameters)) { return (SimpleSet)localFields_String_values.get(_parameters); } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); SimpleSet localFields_String_value = localFields_compute(name); if(true) localFields_String_values.put(_parameters, localFields_String_value); return localFields_String_value; } /** * @apilevel internal */ private SimpleSet localFields_compute(String name) { SimpleSet set = SimpleSet.emptySet; for(Iterator iter = original().localFields(name).iterator(); iter.hasNext(); ) { FieldDeclaration f = (FieldDeclaration)iter.next(); /* ES removing this: if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) { BodyDecl b = f.substitutedBodyDecl(this); addBodyDecl(b); // Here we should access b through an ordinary // child accessor instead of setting is$Final directly, // however doing so appears to cause unexpected behaviour! b.is$Final = true; f = (FieldDeclaration) b; } set = set.add(f); * and replacing with: */ if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) { BodyDecl fCopy = ((BodyDeclList)getBodyDeclList()).localFieldCopy(f, this); f = (FieldDeclaration) fCopy; } set = set.add(f); } return set; } protected java.util.Map localTypeDecls_String_values; /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1154 */ @SuppressWarnings({"unchecked", "cast"}) public SimpleSet localTypeDecls(String name) { Object _parameters = name; if(localTypeDecls_String_values == null) localTypeDecls_String_values = new java.util.HashMap(4); ASTNode$State.CircularValue _value; if(localTypeDecls_String_values.containsKey(_parameters)) { Object _o = localTypeDecls_String_values.get(_parameters); if(!(_o instanceof ASTNode$State.CircularValue)) { return (SimpleSet)_o; } else _value = (ASTNode$State.CircularValue)_o; } else { _value = new ASTNode$State.CircularValue(); localTypeDecls_String_values.put(_parameters, _value); _value.value = SimpleSet.emptySet; } ASTNode$State state = state(); if (!state.IN_CIRCLE) { state.IN_CIRCLE = true; int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); SimpleSet new_localTypeDecls_String_value; do { _value.visited = new Integer(state.CIRCLE_INDEX); state.CHANGE = false; new_localTypeDecls_String_value = localTypeDecls_compute(name); if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) { state.CHANGE = true; _value.value = new_localTypeDecls_String_value; } state.CIRCLE_INDEX++; } while (state.CHANGE); if(true) { localTypeDecls_String_values.put(_parameters, new_localTypeDecls_String_value); } else { localTypeDecls_String_values.remove(_parameters); state.RESET_CYCLE = true; localTypeDecls_compute(name); state.RESET_CYCLE = false; } state.IN_CIRCLE = false; return new_localTypeDecls_String_value; } if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) { _value.visited = new Integer(state.CIRCLE_INDEX); SimpleSet new_localTypeDecls_String_value = localTypeDecls_compute(name); if (state.RESET_CYCLE) { localTypeDecls_String_values.remove(_parameters); } else if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) { state.CHANGE = true; _value.value = new_localTypeDecls_String_value; } return new_localTypeDecls_String_value; } return (SimpleSet)_value.value; } /** * @apilevel internal */ private SimpleSet localTypeDecls_compute(String name) { SimpleSet set = SimpleSet.emptySet; for(Iterator iter = original().localTypeDecls(name).iterator(); iter.hasNext(); ) { TypeDecl t = (TypeDecl)iter.next(); /* ES: removing this: if(t.isStatic()) set = set.add(t); else { BodyDecl b; TypeDecl typeDecl; if(t instanceof ClassDecl) { ClassDecl classDecl = (ClassDecl)t; typeDecl = classDecl.substitutedClassDecl(this); b = new MemberClassDecl((ClassDecl)typeDecl); addBodyDecl(b); // Here we should access b through an ordinary // child accessor instead of setting is$Final directly, // however doing so appears to cause unexpected behaviour! b.is$Final = true; set = set.add(typeDecl); } else if(t instanceof InterfaceDecl) { InterfaceDecl interfaceDecl = (InterfaceDecl)t; typeDecl = interfaceDecl.substitutedInterfaceDecl(this); b = new MemberInterfaceDecl((InterfaceDecl)typeDecl); addBodyDecl(b); // Here we should access b through an ordinary // child accessor instead of setting is$Final directly, // however doing so appears to cause unexpected behaviour! b.is$Final = true; set = set.add(typeDecl); } } * and replacing with: */ if(t.isStatic()) { set = set.add(t); } else if (t instanceof ClassDecl) { MemberClassDecl copy = ((BodyDeclList)getBodyDeclList()).localClassDeclCopy((ClassDecl)t, this); set = set.add(copy.getClassDecl()); } else if (t instanceof InterfaceDecl) { MemberInterfaceDecl copy = ((BodyDeclList)getBodyDeclList()).localInterfaceDeclCopy((InterfaceDecl)t, this); set = set.add(copy.getInterfaceDecl()); } } return set; } /** * @apilevel internal */ protected boolean constructors_computed = false; /** * @apilevel internal */ protected Collection constructors_value; /** * @attribute syn * @aspect LookupParTypeDecl * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/Generics.jrag:1213 */ @SuppressWarnings({"unchecked", "cast"}) public Collection constructors() { if(constructors_computed) { return constructors_value; } ASTNode$State state = state(); int num = state.boundariesCrossed; boolean isFinal = this.is$Final(); constructors_value = constructors_compute(); if(isFinal && num == state().boundariesCrossed) constructors_computed = true; return constructors_value; } /** * @apilevel internal */ private Collection constructors_compute() { Collection set = new ArrayList(); for(Iterator iter = original().constructors().iterator(); iter.hasNext(); ) { ConstructorDecl c = (ConstructorDecl)iter.next(); /* ES: removing this: BodyDecl b = c.substitutedBodyDecl(this); addBodyDecl(b); // Here we should access b through an ordinary // child accessor instead of setting is$Final directly, // however doing so appears to cause unexpected behaviour! b.is$Final = true; * and replacing with: */ BodyDecl b = ((BodyDeclList)getBodyDeclList()).constructorCopy(c, this); set.add(b); } return set; } /** * @apilevel internal */ public ASTNode rewriteTo() { return super.rewriteTo(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy