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