001    /* This file was generated with JastAdd2 (http://jastadd.org) version R20130213 */
002    package AST;
003    
004    import java.util.HashSet;
005    import java.io.File;
006    import java.util.*;
007    import beaver.*;
008    import java.util.ArrayList;
009    import java.util.zip.*;
010    import java.io.*;
011    import java.io.FileNotFoundException;
012    import java.util.Collection;
013    /**
014     * @production GenericInterfaceDeclSubstituted : {@link GenericInterfaceDecl} ::= <span class="component">&lt;Original:TypeDecl&gt;</span> <span class="component">{@link BodyDecl}*</span>;
015     * @ast node
016     * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.ast:44
017     */
018    public class GenericInterfaceDeclSubstituted extends GenericInterfaceDecl implements Cloneable, MemberSubstitutor {
019      /**
020       * @apilevel low-level
021       */
022      public void flushCache() {
023      }
024      /**
025       * @apilevel internal
026       */
027      public void flushCollectionCache() {
028      }
029      /**
030       * @apilevel internal
031       */
032      @SuppressWarnings({"unchecked", "cast"})
033      public GenericInterfaceDeclSubstituted clone() throws CloneNotSupportedException {
034        GenericInterfaceDeclSubstituted node = (GenericInterfaceDeclSubstituted)super.clone();
035        node.getBodyDeclList_computed = false;
036        node.getBodyDeclList_value = null;
037        node.sourceTypeDecl_computed = false;
038        node.sourceTypeDecl_value = null;
039        node.instanceOf_TypeDecl_values = null;
040        node.subtype_TypeDecl_values = null;
041        node.typeDescriptor_computed = false;
042        node.typeDescriptor_value = null;
043        node.constantPoolName_computed = false;
044        node.constantPoolName_value = null;
045        node.uniqueIndex_computed = false;
046        node.localMethodsSignatureMap_computed = false;
047        node.localMethodsSignatureMap_value = null;
048        node.localFields_String_values = null;
049        node.localTypeDecls_String_values = null;
050        node.constructors_computed = false;
051        node.constructors_value = null;
052        node.in$Circle(false);
053        node.is$Final(false);
054        return node;
055      }
056    /**
057     * @apilevel internal
058     */
059      @SuppressWarnings({"unchecked", "cast"})
060    public GenericInterfaceDeclSubstituted copy() {
061      
062      try {
063        GenericInterfaceDeclSubstituted node = (GenericInterfaceDeclSubstituted) clone();
064        node.parent = null;
065        if(children != null)
066          node.children = (ASTNode[]) children.clone();
067        
068        return node;
069      } catch (CloneNotSupportedException e) {
070        throw new Error("Error: clone not supported for " + getClass().getName());
071      }
072      
073    }/**
074     * Create a deep copy of the AST subtree at this node.
075     * The copy is dangling, i.e. has no parent.
076     * @return dangling copy of the subtree at this node
077     * @apilevel low-level
078     */
079      @SuppressWarnings({"unchecked", "cast"})
080    public GenericInterfaceDeclSubstituted fullCopy() {
081      
082      GenericInterfaceDeclSubstituted tree = (GenericInterfaceDeclSubstituted) copy();
083      if (children != null) {
084        for (int i = 0; i < children.length; ++i) {
085                    switch (i) {
086                    case 5:
087                      tree.children[i] = new List();
088                      continue;
089                    }
090          ASTNode child = (ASTNode) children[i];
091          if(child != null) {
092            child = child.fullCopy();
093            tree.setChild(child, i);
094          }
095        }
096      }
097      return tree;
098      
099    }  /**
100       * @ast method 
101       * 
102       */
103      public GenericInterfaceDeclSubstituted() {
104        super();
105    
106    
107      }
108      /**
109       * Initializes the child array to the correct size.
110       * Initializes List and Opt nta children.
111       * @apilevel internal
112       * @ast method
113       * @ast method 
114       * 
115       */
116      public void init$Children() {
117        children = new ASTNode[4];
118        setChild(new List(), 1);
119        setChild(new List(), 2);
120        setChild(new List(), 3);
121      }
122      /**
123       * @ast method 
124       * 
125       */
126      public GenericInterfaceDeclSubstituted(Modifiers p0, String p1, List<Access> p2, List<TypeVariable> p3, TypeDecl p4) {
127        setChild(p0, 0);
128        setID(p1);
129        setChild(p2, 1);
130        setChild(p3, 2);
131        setOriginal(p4);
132      }
133      /**
134       * @ast method 
135       * 
136       */
137      public GenericInterfaceDeclSubstituted(Modifiers p0, beaver.Symbol p1, List<Access> p2, List<TypeVariable> p3, TypeDecl p4) {
138        setChild(p0, 0);
139        setID(p1);
140        setChild(p2, 1);
141        setChild(p3, 2);
142        setOriginal(p4);
143      }
144      /**
145       * @apilevel low-level
146       * @ast method 
147       * 
148       */
149      protected int numChildren() {
150        return 3;
151      }
152      /**
153       * @apilevel internal
154       * @ast method 
155       * 
156       */
157      public boolean mayHaveRewrite() {
158        return false;
159      }
160      /**
161       * Replaces the Modifiers child.
162       * @param node The new node to replace the Modifiers child.
163       * @apilevel high-level
164       * @ast method 
165       * 
166       */
167      public void setModifiers(Modifiers node) {
168        setChild(node, 0);
169      }
170      /**
171       * Retrieves the Modifiers child.
172       * @return The current node used as the Modifiers child.
173       * @apilevel high-level
174       * @ast method 
175       * 
176       */
177      public Modifiers getModifiers() {
178        return (Modifiers)getChild(0);
179      }
180      /**
181       * Retrieves the Modifiers child.
182       * <p><em>This method does not invoke AST transformations.</em></p>
183       * @return The current node used as the Modifiers child.
184       * @apilevel low-level
185       * @ast method 
186       * 
187       */
188      public Modifiers getModifiersNoTransform() {
189        return (Modifiers)getChildNoTransform(0);
190      }
191      /**
192       * Replaces the lexeme ID.
193       * @param value The new value for the lexeme ID.
194       * @apilevel high-level
195       * @ast method 
196       * 
197       */
198      public void setID(String value) {
199        tokenString_ID = value;
200      }
201      /**
202       * JastAdd-internal setter for lexeme ID using the Beaver parser.
203       * @apilevel internal
204       * @ast method 
205       * 
206       */
207      public void setID(beaver.Symbol symbol) {
208        if(symbol.value != null && !(symbol.value instanceof String))
209          throw new UnsupportedOperationException("setID is only valid for String lexemes");
210        tokenString_ID = (String)symbol.value;
211        IDstart = symbol.getStart();
212        IDend = symbol.getEnd();
213      }
214      /**
215       * Retrieves the value for the lexeme ID.
216       * @return The value for the lexeme ID.
217       * @apilevel high-level
218       * @ast method 
219       * 
220       */
221      public String getID() {
222        return tokenString_ID != null ? tokenString_ID : "";
223      }
224      /**
225       * Replaces the SuperInterfaceId list.
226       * @param list The new list node to be used as the SuperInterfaceId list.
227       * @apilevel high-level
228       * @ast method 
229       * 
230       */
231      public void setSuperInterfaceIdList(List<Access> list) {
232        setChild(list, 1);
233      }
234      /**
235       * Retrieves the number of children in the SuperInterfaceId list.
236       * @return Number of children in the SuperInterfaceId list.
237       * @apilevel high-level
238       * @ast method 
239       * 
240       */
241      public int getNumSuperInterfaceId() {
242        return getSuperInterfaceIdList().getNumChild();
243      }
244      /**
245       * Retrieves the number of children in the SuperInterfaceId list.
246       * Calling this method will not trigger rewrites..
247       * @return Number of children in the SuperInterfaceId list.
248       * @apilevel low-level
249       * @ast method 
250       * 
251       */
252      public int getNumSuperInterfaceIdNoTransform() {
253        return getSuperInterfaceIdListNoTransform().getNumChildNoTransform();
254      }
255      /**
256       * Retrieves the element at index {@code i} in the SuperInterfaceId list..
257       * @param i Index of the element to return.
258       * @return The element at position {@code i} in the SuperInterfaceId list.
259       * @apilevel high-level
260       * @ast method 
261       * 
262       */
263      @SuppressWarnings({"unchecked", "cast"})
264      public Access getSuperInterfaceId(int i) {
265        return (Access)getSuperInterfaceIdList().getChild(i);
266      }
267      /**
268       * Append an element to the SuperInterfaceId list.
269       * @param node The element to append to the SuperInterfaceId list.
270       * @apilevel high-level
271       * @ast method 
272       * 
273       */
274      public void addSuperInterfaceId(Access node) {
275        List<Access> list = (parent == null || state == null) ? getSuperInterfaceIdListNoTransform() : getSuperInterfaceIdList();
276        list.addChild(node);
277      }
278      /**
279       * @apilevel low-level
280       * @ast method 
281       * 
282       */
283      public void addSuperInterfaceIdNoTransform(Access node) {
284        List<Access> list = getSuperInterfaceIdListNoTransform();
285        list.addChild(node);
286      }
287      /**
288       * Replaces the SuperInterfaceId list element at index {@code i} with the new node {@code node}.
289       * @param node The new node to replace the old list element.
290       * @param i The list index of the node to be replaced.
291       * @apilevel high-level
292       * @ast method 
293       * 
294       */
295      public void setSuperInterfaceId(Access node, int i) {
296        List<Access> list = getSuperInterfaceIdList();
297        list.setChild(node, i);
298      }
299      /**
300       * Retrieves the SuperInterfaceId list.
301       * @return The node representing the SuperInterfaceId list.
302       * @apilevel high-level
303       * @ast method 
304       * 
305       */
306      public List<Access> getSuperInterfaceIds() {
307        return getSuperInterfaceIdList();
308      }
309      /**
310       * Retrieves the SuperInterfaceId list.
311       * <p><em>This method does not invoke AST transformations.</em></p>
312       * @return The node representing the SuperInterfaceId list.
313       * @apilevel low-level
314       * @ast method 
315       * 
316       */
317      public List<Access> getSuperInterfaceIdsNoTransform() {
318        return getSuperInterfaceIdListNoTransform();
319      }
320      /**
321       * Retrieves the SuperInterfaceId list.
322       * @return The node representing the SuperInterfaceId list.
323       * @apilevel high-level
324       * @ast method 
325       * 
326       */
327      @SuppressWarnings({"unchecked", "cast"})
328      public List<Access> getSuperInterfaceIdList() {
329        List<Access> list = (List<Access>)getChild(1);
330        list.getNumChild();
331        return list;
332      }
333      /**
334       * Retrieves the SuperInterfaceId list.
335       * <p><em>This method does not invoke AST transformations.</em></p>
336       * @return The node representing the SuperInterfaceId list.
337       * @apilevel low-level
338       * @ast method 
339       * 
340       */
341      @SuppressWarnings({"unchecked", "cast"})
342      public List<Access> getSuperInterfaceIdListNoTransform() {
343        return (List<Access>)getChildNoTransform(1);
344      }
345      /**
346       * Replaces the TypeParameter list.
347       * @param list The new list node to be used as the TypeParameter list.
348       * @apilevel high-level
349       * @ast method 
350       * 
351       */
352      public void setTypeParameterList(List<TypeVariable> list) {
353        setChild(list, 2);
354      }
355      /**
356       * Retrieves the number of children in the TypeParameter list.
357       * @return Number of children in the TypeParameter list.
358       * @apilevel high-level
359       * @ast method 
360       * 
361       */
362      public int getNumTypeParameter() {
363        return getTypeParameterList().getNumChild();
364      }
365      /**
366       * Retrieves the number of children in the TypeParameter list.
367       * Calling this method will not trigger rewrites..
368       * @return Number of children in the TypeParameter list.
369       * @apilevel low-level
370       * @ast method 
371       * 
372       */
373      public int getNumTypeParameterNoTransform() {
374        return getTypeParameterListNoTransform().getNumChildNoTransform();
375      }
376      /**
377       * Retrieves the element at index {@code i} in the TypeParameter list..
378       * @param i Index of the element to return.
379       * @return The element at position {@code i} in the TypeParameter list.
380       * @apilevel high-level
381       * @ast method 
382       * 
383       */
384      @SuppressWarnings({"unchecked", "cast"})
385      public TypeVariable getTypeParameter(int i) {
386        return (TypeVariable)getTypeParameterList().getChild(i);
387      }
388      /**
389       * Append an element to the TypeParameter list.
390       * @param node The element to append to the TypeParameter list.
391       * @apilevel high-level
392       * @ast method 
393       * 
394       */
395      public void addTypeParameter(TypeVariable node) {
396        List<TypeVariable> list = (parent == null || state == null) ? getTypeParameterListNoTransform() : getTypeParameterList();
397        list.addChild(node);
398      }
399      /**
400       * @apilevel low-level
401       * @ast method 
402       * 
403       */
404      public void addTypeParameterNoTransform(TypeVariable node) {
405        List<TypeVariable> list = getTypeParameterListNoTransform();
406        list.addChild(node);
407      }
408      /**
409       * Replaces the TypeParameter list element at index {@code i} with the new node {@code node}.
410       * @param node The new node to replace the old list element.
411       * @param i The list index of the node to be replaced.
412       * @apilevel high-level
413       * @ast method 
414       * 
415       */
416      public void setTypeParameter(TypeVariable node, int i) {
417        List<TypeVariable> list = getTypeParameterList();
418        list.setChild(node, i);
419      }
420      /**
421       * Retrieves the TypeParameter list.
422       * @return The node representing the TypeParameter list.
423       * @apilevel high-level
424       * @ast method 
425       * 
426       */
427      public List<TypeVariable> getTypeParameters() {
428        return getTypeParameterList();
429      }
430      /**
431       * Retrieves the TypeParameter list.
432       * <p><em>This method does not invoke AST transformations.</em></p>
433       * @return The node representing the TypeParameter list.
434       * @apilevel low-level
435       * @ast method 
436       * 
437       */
438      public List<TypeVariable> getTypeParametersNoTransform() {
439        return getTypeParameterListNoTransform();
440      }
441      /**
442       * Retrieves the TypeParameter list.
443       * @return The node representing the TypeParameter list.
444       * @apilevel high-level
445       * @ast method 
446       * 
447       */
448      @SuppressWarnings({"unchecked", "cast"})
449      public List<TypeVariable> getTypeParameterList() {
450        List<TypeVariable> list = (List<TypeVariable>)getChild(2);
451        list.getNumChild();
452        return list;
453      }
454      /**
455       * Retrieves the TypeParameter list.
456       * <p><em>This method does not invoke AST transformations.</em></p>
457       * @return The node representing the TypeParameter list.
458       * @apilevel low-level
459       * @ast method 
460       * 
461       */
462      @SuppressWarnings({"unchecked", "cast"})
463      public List<TypeVariable> getTypeParameterListNoTransform() {
464        return (List<TypeVariable>)getChildNoTransform(2);
465      }
466      /**
467       * Replaces the lexeme Original.
468       * @param value The new value for the lexeme Original.
469       * @apilevel high-level
470       * @ast method 
471       * 
472       */
473      public void setOriginal(TypeDecl value) {
474        tokenTypeDecl_Original = value;
475      }
476      /**
477       * @apilevel internal
478       * @ast method 
479       * 
480       */
481      
482      /**
483       * @apilevel internal
484       */
485      protected TypeDecl tokenTypeDecl_Original;
486      /**
487       * Retrieves the value for the lexeme Original.
488       * @return The value for the lexeme Original.
489       * @apilevel high-level
490       * @ast method 
491       * 
492       */
493      public TypeDecl getOriginal() {
494        return tokenTypeDecl_Original;
495      }
496      /**
497       * Replaces the BodyDecl list.
498       * @param list The new list node to be used as the BodyDecl list.
499       * @apilevel high-level
500       * @ast method 
501       * 
502       */
503      public void setBodyDeclList(List<BodyDecl> list) {
504        setChild(list, 3);
505      }
506      /**
507       * Retrieves the number of children in the BodyDecl list.
508       * @return Number of children in the BodyDecl list.
509       * @apilevel high-level
510       * @ast method 
511       * 
512       */
513      public int getNumBodyDecl() {
514        return getBodyDeclList().getNumChild();
515      }
516      /**
517       * Retrieves the number of children in the BodyDecl list.
518       * Calling this method will not trigger rewrites..
519       * @return Number of children in the BodyDecl list.
520       * @apilevel low-level
521       * @ast method 
522       * 
523       */
524      public int getNumBodyDeclNoTransform() {
525        return getBodyDeclListNoTransform().getNumChildNoTransform();
526      }
527      /**
528       * Retrieves the element at index {@code i} in the BodyDecl list..
529       * @param i Index of the element to return.
530       * @return The element at position {@code i} in the BodyDecl list.
531       * @apilevel high-level
532       * @ast method 
533       * 
534       */
535      @SuppressWarnings({"unchecked", "cast"})
536      public BodyDecl getBodyDecl(int i) {
537        return (BodyDecl)getBodyDeclList().getChild(i);
538      }
539      /**
540       * Append an element to the BodyDecl list.
541       * @param node The element to append to the BodyDecl list.
542       * @apilevel high-level
543       * @ast method 
544       * 
545       */
546      public void addBodyDecl(BodyDecl node) {
547        List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();
548        list.addChild(node);
549      }
550      /**
551       * @apilevel low-level
552       * @ast method 
553       * 
554       */
555      public void addBodyDeclNoTransform(BodyDecl node) {
556        List<BodyDecl> list = getBodyDeclListNoTransform();
557        list.addChild(node);
558      }
559      /**
560       * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}.
561       * @param node The new node to replace the old list element.
562       * @param i The list index of the node to be replaced.
563       * @apilevel high-level
564       * @ast method 
565       * 
566       */
567      public void setBodyDecl(BodyDecl node, int i) {
568        List<BodyDecl> list = getBodyDeclList();
569        list.setChild(node, i);
570      }
571      /**
572       * Retrieves the BodyDecl list.
573       * @return The node representing the BodyDecl list.
574       * @apilevel high-level
575       * @ast method 
576       * 
577       */
578      public List<BodyDecl> getBodyDecls() {
579        return getBodyDeclList();
580      }
581      /**
582       * Retrieves the BodyDecl list.
583       * <p><em>This method does not invoke AST transformations.</em></p>
584       * @return The node representing the BodyDecl list.
585       * @apilevel low-level
586       * @ast method 
587       * 
588       */
589      public List<BodyDecl> getBodyDeclsNoTransform() {
590        return getBodyDeclListNoTransform();
591      }
592      /**
593       * Retrieves the BodyDecl list.
594       * <p><em>This method does not invoke AST transformations.</em></p>
595       * @return The node representing the BodyDecl list.
596       * @apilevel low-level
597       * @ast method 
598       * 
599       */
600      public List<BodyDecl> getBodyDeclListNoTransform() {
601        return (List<BodyDecl>)getChildNoTransform(3);
602      }
603      /**
604       * Retrieves the child position of the BodyDecl list.
605       * @return The the child position of the BodyDecl list.
606       * @apilevel low-level
607       * @ast method 
608       * 
609       */
610      protected int getBodyDeclListChildPosition() {
611        return 3;
612      }
613      /**
614       * @attribute syn
615       * @aspect NestedTypes
616       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:569
617       */
618      public TypeDecl hostType() {
619        ASTNode$State state = state();
620        try {  return getOriginal();  }
621        finally {
622        }
623      }
624      /**
625       * @apilevel internal
626       */
627      protected boolean getBodyDeclList_computed = false;
628      /**
629       * @apilevel internal
630       */
631      protected List getBodyDeclList_value;
632      /**
633       * @attribute syn nta
634       * @aspect LookupParTypeDecl
635       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1053
636       */
637      @SuppressWarnings({"unchecked", "cast"})
638      public List getBodyDeclList() {
639        if(getBodyDeclList_computed) {
640          return (List) getChild(getBodyDeclListChildPosition());
641        }
642          ASTNode$State state = state();
643      int num = state.boundariesCrossed;
644      boolean isFinal = this.is$Final();
645        getBodyDeclList_value = getBodyDeclList_compute();
646        setBodyDeclList(getBodyDeclList_value);
647      if(isFinal && num == state().boundariesCrossed){ getBodyDeclList_computed = true; }
648        List node = (List) this.getChild(getBodyDeclListChildPosition());
649        return node;
650      }
651      /**
652       * @apilevel internal
653       */
654      private List getBodyDeclList_compute() {  return new BodyDeclList();  }
655      /**
656       * @attribute syn
657       * @aspect LookupParTypeDecl
658       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1306
659       */
660      public TypeDecl original() {
661        ASTNode$State state = state();
662        try {  return getOriginal().original();  }
663        finally {
664        }
665      }
666      /**
667       * @apilevel internal
668       */
669      protected boolean sourceTypeDecl_computed = false;
670      /**
671       * @apilevel internal
672       */
673      protected TypeDecl sourceTypeDecl_value;
674      /**
675       * @attribute syn
676       * @aspect SourceDeclarations
677       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1509
678       */
679      @SuppressWarnings({"unchecked", "cast"})
680      public TypeDecl sourceTypeDecl() {
681        if(sourceTypeDecl_computed) {
682          return sourceTypeDecl_value;
683        }
684          ASTNode$State state = state();
685      int num = state.boundariesCrossed;
686      boolean isFinal = this.is$Final();
687        sourceTypeDecl_value = sourceTypeDecl_compute();
688      if(isFinal && num == state().boundariesCrossed){ sourceTypeDecl_computed = true; }
689            return sourceTypeDecl_value;
690      }
691      /**
692       * @apilevel internal
693       */
694      private TypeDecl sourceTypeDecl_compute() {  return original().sourceTypeDecl();  }
695      protected java.util.Map instanceOf_TypeDecl_values;
696      /**
697       * @attribute syn
698       * @aspect GenericsSubtype
699       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:489
700       */
701      @SuppressWarnings({"unchecked", "cast"})
702      public boolean instanceOf(TypeDecl type) {
703        Object _parameters = type;
704        if(instanceOf_TypeDecl_values == null) instanceOf_TypeDecl_values = new java.util.HashMap(4);
705        if(instanceOf_TypeDecl_values.containsKey(_parameters)) {
706          return ((Boolean)instanceOf_TypeDecl_values.get(_parameters)).booleanValue();
707        }
708          ASTNode$State state = state();
709      int num = state.boundariesCrossed;
710      boolean isFinal = this.is$Final();
711        boolean instanceOf_TypeDecl_value = instanceOf_compute(type);
712      if(isFinal && num == state().boundariesCrossed){ instanceOf_TypeDecl_values.put(_parameters, Boolean.valueOf(instanceOf_TypeDecl_value)); }
713            return instanceOf_TypeDecl_value;
714      }
715      /**
716       * @apilevel internal
717       */
718      private boolean instanceOf_compute(TypeDecl type) {  return subtype(type);  }
719      protected java.util.Map subtype_TypeDecl_values;
720      /**
721       * @attribute syn
722       * @aspect GenericsSubtype
723       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:521
724       */
725      @SuppressWarnings({"unchecked", "cast"})
726      public boolean subtype(TypeDecl type) {
727        Object _parameters = type;
728        if(subtype_TypeDecl_values == null) subtype_TypeDecl_values = new java.util.HashMap(4);
729        ASTNode$State.CircularValue _value;
730        if(subtype_TypeDecl_values.containsKey(_parameters)) {
731          Object _o = subtype_TypeDecl_values.get(_parameters);
732          if(!(_o instanceof ASTNode$State.CircularValue)) {
733            return ((Boolean)_o).booleanValue();
734          }
735          else
736            _value = (ASTNode$State.CircularValue)_o;
737        }
738        else {
739          _value = new ASTNode$State.CircularValue();
740          subtype_TypeDecl_values.put(_parameters, _value);
741          _value.value = Boolean.valueOf(true);
742        }
743        ASTNode$State state = state();
744        if (!state.IN_CIRCLE) {
745          state.IN_CIRCLE = true;
746          int num = state.boundariesCrossed;
747          boolean isFinal = this.is$Final();
748          boolean new_subtype_TypeDecl_value;
749          do {
750            _value.visited = new Integer(state.CIRCLE_INDEX);
751            state.CHANGE = false;
752            new_subtype_TypeDecl_value = subtype_compute(type);
753            if (new_subtype_TypeDecl_value!=((Boolean)_value.value).booleanValue()) {
754              state.CHANGE = true;
755              _value.value = Boolean.valueOf(new_subtype_TypeDecl_value);
756            }
757            state.CIRCLE_INDEX++;
758          } while (state.CHANGE);
759            if(isFinal && num == state().boundariesCrossed) {
760            subtype_TypeDecl_values.put(_parameters, new_subtype_TypeDecl_value);
761          }
762          else {
763            subtype_TypeDecl_values.remove(_parameters);
764          state.RESET_CYCLE = true;
765          subtype_compute(type);
766          state.RESET_CYCLE = false;
767          }
768          state.IN_CIRCLE = false; 
769          return new_subtype_TypeDecl_value;
770        }
771        if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) {
772          _value.visited = new Integer(state.CIRCLE_INDEX);
773          boolean new_subtype_TypeDecl_value = subtype_compute(type);
774          if (state.RESET_CYCLE) {
775            subtype_TypeDecl_values.remove(_parameters);
776          }
777          else if (new_subtype_TypeDecl_value!=((Boolean)_value.value).booleanValue()) {
778            state.CHANGE = true;
779            _value.value = new_subtype_TypeDecl_value;
780          }
781          return new_subtype_TypeDecl_value;
782        }
783        return ((Boolean)_value.value).booleanValue();
784      }
785      /**
786       * @apilevel internal
787       */
788      private boolean subtype_compute(TypeDecl type) {  return type.supertypeGenericInterfaceDeclSubstituted(this);  }
789      /**
790       * @attribute syn
791       * @aspect GenericsSubtype
792       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:523
793       */
794      public boolean supertypeGenericInterfaceDeclSubstituted(GenericInterfaceDeclSubstituted type) {
795        ASTNode$State state = state();
796        try {  return original() == type.original() && type.enclosingType().subtype(enclosingType()) || super.supertypeGenericInterfaceDeclSubstituted(type);  }
797        finally {
798        }
799      }
800      /**
801       * @attribute syn
802       * @aspect GenericsSubtype
803       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:20
804       */
805      public boolean supertypeGenericInterfaceDecl(GenericInterfaceDecl type) {
806        ASTNode$State state = state();
807        try {  return super.supertypeGenericInterfaceDecl(type) || original().supertypeGenericInterfaceDecl(type);  }
808        finally {
809        }
810      }
811      /**
812       * @apilevel internal
813       */
814      protected boolean typeDescriptor_computed = false;
815      /**
816       * @apilevel internal
817       */
818      protected String typeDescriptor_value;
819      /**
820       * @attribute syn
821       * @aspect GenericsCodegen
822       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/GenericsCodegen.jrag:20
823       */
824      @SuppressWarnings({"unchecked", "cast"})
825      public String typeDescriptor() {
826        if(typeDescriptor_computed) {
827          return typeDescriptor_value;
828        }
829          ASTNode$State state = state();
830      int num = state.boundariesCrossed;
831      boolean isFinal = this.is$Final();
832        typeDescriptor_value = typeDescriptor_compute();
833      if(isFinal && num == state().boundariesCrossed){ typeDescriptor_computed = true; }
834            return typeDescriptor_value;
835      }
836      /**
837       * @apilevel internal
838       */
839      private String typeDescriptor_compute() {  return original().typeDescriptor();  }
840      /**
841       * @apilevel internal
842       */
843      protected boolean constantPoolName_computed = false;
844      /**
845       * @apilevel internal
846       */
847      protected String constantPoolName_value;
848      /**
849       * @attribute syn
850       * @aspect GenericsCodegen
851       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/GenericsCodegen.jrag:25
852       */
853      @SuppressWarnings({"unchecked", "cast"})
854      public String constantPoolName() {
855        if(constantPoolName_computed) {
856          return constantPoolName_value;
857        }
858          ASTNode$State state = state();
859      int num = state.boundariesCrossed;
860      boolean isFinal = this.is$Final();
861        constantPoolName_value = constantPoolName_compute();
862      if(isFinal && num == state().boundariesCrossed){ constantPoolName_computed = true; }
863            return constantPoolName_value;
864      }
865      /**
866       * @apilevel internal
867       */
868      private String constantPoolName_compute() {  return original().constantPoolName();  }
869      /**
870       * @apilevel internal
871       */
872      protected boolean uniqueIndex_computed = false;
873      /**
874       * @apilevel internal
875       */
876      protected int uniqueIndex_value;
877      /**
878       * @attribute syn
879       * @aspect GenericsCodegen
880       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/GenericsCodegen.jrag:32
881       */
882      @SuppressWarnings({"unchecked", "cast"})
883      public int uniqueIndex() {
884        if(uniqueIndex_computed) {
885          return uniqueIndex_value;
886        }
887          ASTNode$State state = state();
888      int num = state.boundariesCrossed;
889      boolean isFinal = this.is$Final();
890        uniqueIndex_value = uniqueIndex_compute();
891      if(isFinal && num == state().boundariesCrossed){ uniqueIndex_computed = true; }
892            return uniqueIndex_value;
893      }
894      /**
895       * @apilevel internal
896       */
897      private int uniqueIndex_compute() {  return original().uniqueIndex();  }
898      /**
899       * @attribute syn
900       * @aspect CreateBCode
901       * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CreateBCode.jrag:820
902       */
903      public String arrayTypeDescriptor() {
904        ASTNode$State state = state();
905        try {  return original().arrayTypeDescriptor();  }
906        finally {
907        }
908      }
909      /**
910       * @apilevel internal
911       */
912      protected boolean localMethodsSignatureMap_computed = false;
913      /**
914       * @apilevel internal
915       */
916      protected HashMap localMethodsSignatureMap_value;
917      /**
918       * @attribute syn
919       * @aspect LookupParTypeDecl
920       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1084
921       */
922      @SuppressWarnings({"unchecked", "cast"})
923      public HashMap localMethodsSignatureMap() {
924        if(localMethodsSignatureMap_computed) {
925          return localMethodsSignatureMap_value;
926        }
927          ASTNode$State state = state();
928      int num = state.boundariesCrossed;
929      boolean isFinal = this.is$Final();
930        localMethodsSignatureMap_value = localMethodsSignatureMap_compute();
931      if(true){ localMethodsSignatureMap_computed = true; }
932            return localMethodsSignatureMap_value;
933      }
934      /**
935       * @apilevel internal
936       */
937      private HashMap localMethodsSignatureMap_compute() {
938        HashMap map = new HashMap();
939        for(Iterator iter = original().localMethodsIterator(); iter.hasNext(); ) {
940          MethodDecl decl = (MethodDecl)iter.next();
941    
942          /* ES removing this:
943          if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) {
944            BodyDecl b = decl.substitutedBodyDecl(this);
945            addBodyDecl(b);
946               // Here we should access b through an ordinary
947               // child accessor instead of setting is$Final directly,
948               // however doing so appears to cause unexpected behaviour!
949            b.is$Final = true;
950            decl = (MethodDecl) b;
951          }
952          map.put(decl.signature(), decl);
953          * and replacing with:
954          */
955          if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) {
956            BodyDecl copyDecl = ((BodyDeclList)getBodyDeclList()).localMethodSignatureCopy(decl, this);
957            decl = (MethodDecl) copyDecl;
958          }
959          map.put(decl.signature(), decl);
960    
961        }
962        return map;
963      }
964      protected java.util.Map localFields_String_values;
965      /**
966       * @attribute syn
967       * @aspect LookupParTypeDecl
968       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1119
969       */
970      @SuppressWarnings({"unchecked", "cast"})
971      public SimpleSet localFields(String name) {
972        Object _parameters = name;
973        if(localFields_String_values == null) localFields_String_values = new java.util.HashMap(4);
974        if(localFields_String_values.containsKey(_parameters)) {
975          return (SimpleSet)localFields_String_values.get(_parameters);
976        }
977          ASTNode$State state = state();
978      int num = state.boundariesCrossed;
979      boolean isFinal = this.is$Final();
980        SimpleSet localFields_String_value = localFields_compute(name);
981      if(true){ localFields_String_values.put(_parameters, localFields_String_value); }
982            return localFields_String_value;
983      }
984      /**
985       * @apilevel internal
986       */
987      private SimpleSet localFields_compute(String name) {
988        SimpleSet set = SimpleSet.emptySet;
989        for(Iterator iter = original().localFields(name).iterator(); iter.hasNext(); ) {
990          FieldDeclaration f = (FieldDeclaration)iter.next();
991    
992          /* ES removing this:   
993          if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) {
994            BodyDecl b = f.substitutedBodyDecl(this);
995            addBodyDecl(b);
996               // Here we should access b through an ordinary
997               // child accessor instead of setting is$Final directly,
998               // however doing so appears to cause unexpected behaviour!
999            b.is$Final = true;
1000            f = (FieldDeclaration) b;
1001          }
1002          set = set.add(f);
1003          * and replacing with:
1004          */
1005          if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) {
1006            BodyDecl fCopy = ((BodyDeclList)getBodyDeclList()).localFieldCopy(f, this);
1007            f = (FieldDeclaration) fCopy;
1008          }
1009          set = set.add(f);
1010    
1011        }
1012        return set;
1013      }
1014      protected java.util.Map localTypeDecls_String_values;
1015      /**
1016       * @attribute syn
1017       * @aspect LookupParTypeDecl
1018       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1154
1019       */
1020      @SuppressWarnings({"unchecked", "cast"})
1021      public SimpleSet localTypeDecls(String name) {
1022        Object _parameters = name;
1023        if(localTypeDecls_String_values == null) localTypeDecls_String_values = new java.util.HashMap(4);
1024        ASTNode$State.CircularValue _value;
1025        if(localTypeDecls_String_values.containsKey(_parameters)) {
1026          Object _o = localTypeDecls_String_values.get(_parameters);
1027          if(!(_o instanceof ASTNode$State.CircularValue)) {
1028            return (SimpleSet)_o;
1029          }
1030          else
1031            _value = (ASTNode$State.CircularValue)_o;
1032        }
1033        else {
1034          _value = new ASTNode$State.CircularValue();
1035          localTypeDecls_String_values.put(_parameters, _value);
1036          _value.value = SimpleSet.emptySet;
1037        }
1038        ASTNode$State state = state();
1039        if (!state.IN_CIRCLE) {
1040          state.IN_CIRCLE = true;
1041          int num = state.boundariesCrossed;
1042          boolean isFinal = this.is$Final();
1043          SimpleSet new_localTypeDecls_String_value;
1044          do {
1045            _value.visited = new Integer(state.CIRCLE_INDEX);
1046            state.CHANGE = false;
1047            new_localTypeDecls_String_value = localTypeDecls_compute(name);
1048            if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) {
1049              state.CHANGE = true;
1050              _value.value = new_localTypeDecls_String_value;
1051            }
1052            state.CIRCLE_INDEX++;
1053          } while (state.CHANGE);
1054            if(true) {
1055            localTypeDecls_String_values.put(_parameters, new_localTypeDecls_String_value);
1056          }
1057          else {
1058            localTypeDecls_String_values.remove(_parameters);
1059          state.RESET_CYCLE = true;
1060          localTypeDecls_compute(name);
1061          state.RESET_CYCLE = false;
1062          }
1063          state.IN_CIRCLE = false; 
1064          return new_localTypeDecls_String_value;
1065        }
1066        if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) {
1067          _value.visited = new Integer(state.CIRCLE_INDEX);
1068          SimpleSet new_localTypeDecls_String_value = localTypeDecls_compute(name);
1069          if (state.RESET_CYCLE) {
1070            localTypeDecls_String_values.remove(_parameters);
1071          }
1072          else if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) {
1073            state.CHANGE = true;
1074            _value.value = new_localTypeDecls_String_value;
1075          }
1076          return new_localTypeDecls_String_value;
1077        }
1078        return (SimpleSet)_value.value;
1079      }
1080      /**
1081       * @apilevel internal
1082       */
1083      private SimpleSet localTypeDecls_compute(String name) {
1084        SimpleSet set = SimpleSet.emptySet;
1085        for(Iterator iter = original().localTypeDecls(name).iterator(); iter.hasNext(); ) {
1086          TypeDecl t = (TypeDecl)iter.next();
1087    
1088          /* ES: removing this:
1089          if(t.isStatic())
1090            set = set.add(t);
1091          else {
1092            BodyDecl b;
1093            TypeDecl typeDecl;
1094            if(t instanceof ClassDecl) {
1095              ClassDecl classDecl = (ClassDecl)t;
1096              typeDecl = classDecl.substitutedClassDecl(this);
1097              b = new MemberClassDecl((ClassDecl)typeDecl);
1098              addBodyDecl(b);
1099               // Here we should access b through an ordinary
1100               // child accessor instead of setting is$Final directly,
1101               // however doing so appears to cause unexpected behaviour!
1102               b.is$Final = true;
1103              set = set.add(typeDecl);
1104            }
1105            else if(t instanceof InterfaceDecl) {
1106              InterfaceDecl interfaceDecl = (InterfaceDecl)t;
1107              typeDecl = interfaceDecl.substitutedInterfaceDecl(this);
1108              b = new MemberInterfaceDecl((InterfaceDecl)typeDecl);
1109              addBodyDecl(b);
1110               // Here we should access b through an ordinary
1111               // child accessor instead of setting is$Final directly,
1112               // however doing so appears to cause unexpected behaviour!
1113               b.is$Final = true;
1114              set = set.add(typeDecl);
1115            }
1116          }
1117          * and replacing with:
1118          */
1119          if(t.isStatic()) {
1120            set = set.add(t);
1121          } else if (t instanceof ClassDecl) {
1122            MemberClassDecl copy = ((BodyDeclList)getBodyDeclList()).localClassDeclCopy((ClassDecl)t, this);
1123            set = set.add(copy.getClassDecl());
1124          } else if (t instanceof InterfaceDecl) {
1125            MemberInterfaceDecl copy = ((BodyDeclList)getBodyDeclList()).localInterfaceDeclCopy((InterfaceDecl)t, this);
1126            set = set.add(copy.getInterfaceDecl());
1127          }
1128        }
1129        return set;
1130      }
1131      /**
1132       * @apilevel internal
1133       */
1134      protected boolean constructors_computed = false;
1135      /**
1136       * @apilevel internal
1137       */
1138      protected Collection constructors_value;
1139      /**
1140       * @attribute syn
1141       * @aspect LookupParTypeDecl
1142       * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1213
1143       */
1144      @SuppressWarnings({"unchecked", "cast"})
1145      public Collection constructors() {
1146        if(constructors_computed) {
1147          return constructors_value;
1148        }
1149          ASTNode$State state = state();
1150      int num = state.boundariesCrossed;
1151      boolean isFinal = this.is$Final();
1152        constructors_value = constructors_compute();
1153      if(isFinal && num == state().boundariesCrossed){ constructors_computed = true; }
1154            return constructors_value;
1155      }
1156      /**
1157       * @apilevel internal
1158       */
1159      private Collection constructors_compute() {
1160        Collection set = new ArrayList();
1161        for(Iterator iter = original().constructors().iterator(); iter.hasNext(); ) {
1162          ConstructorDecl c = (ConstructorDecl)iter.next();
1163    
1164          /* ES: removing this:
1165          BodyDecl b = c.substitutedBodyDecl(this);
1166          addBodyDecl(b);
1167          // Here we should access b through an ordinary
1168          // child accessor instead of setting is$Final directly,
1169          // however doing so appears to cause unexpected behaviour!
1170          b.is$Final = true;
1171          * and replacing with:
1172          */
1173          BodyDecl b = ((BodyDeclList)getBodyDeclList()).constructorCopy(c, this);
1174          set.add(b);
1175        }
1176        return set;
1177      }
1178      /**
1179       * @apilevel internal
1180       */
1181      public ASTNode rewriteTo() {
1182        return super.rewriteTo();
1183      }
1184    }