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