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 ParInterfaceDecl : {@link InterfaceDecl} ::= <span class="component">Argument:{@link Access}*</span> <span class="component">SuperInterfaceId:{@link Access}*</span> <span class="component">{@link BodyDecl}*</span>; 016 * @ast node 017 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.ast:9 018 */ 019 public class ParInterfaceDecl extends InterfaceDecl implements Cloneable, ParTypeDecl, 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 ParInterfaceDecl clone() throws CloneNotSupportedException { 035 ParInterfaceDecl node = (ParInterfaceDecl)super.clone(); 036 node.involvesTypeParameters_visited = -1; 037 node.involvesTypeParameters_computed = false; 038 node.involvesTypeParameters_initialized = false; 039 node.erasure_computed = false; 040 node.erasure_value = null; 041 node.getSuperInterfaceIdList_computed = false; 042 node.getSuperInterfaceIdList_value = null; 043 node.getBodyDeclList_computed = false; 044 node.getBodyDeclList_value = null; 045 node.subtype_TypeDecl_values = null; 046 node.sameStructure_TypeDecl_values = null; 047 node.instanceOf_TypeDecl_values = null; 048 node.typeDescriptor_computed = false; 049 node.typeDescriptor_value = null; 050 node.constantPoolName_computed = false; 051 node.constantPoolName_value = null; 052 node.needsSignatureAttribute_computed = false; 053 node.sameSignature_ArrayList_values = null; 054 node.usesTypeVariable_visited = -1; 055 node.usesTypeVariable_computed = false; 056 node.usesTypeVariable_initialized = false; 057 node.sourceTypeDecl_computed = false; 058 node.sourceTypeDecl_value = null; 059 node.fullName_computed = false; 060 node.fullName_value = null; 061 node.typeName_computed = false; 062 node.typeName_value = null; 063 node.unimplementedMethods_computed = false; 064 node.unimplementedMethods_value = null; 065 node.uniqueIndex_computed = false; 066 node.localMethodsSignatureMap_computed = false; 067 node.localMethodsSignatureMap_value = null; 068 node.localFields_String_values = null; 069 node.localTypeDecls_String_values = null; 070 node.constructors_computed = false; 071 node.constructors_value = null; 072 node.genericDecl_computed = false; 073 node.genericDecl_value = null; 074 node.in$Circle(false); 075 node.is$Final(false); 076 return node; 077 } 078 /** 079 * @apilevel internal 080 */ 081 @SuppressWarnings({"unchecked", "cast"}) 082 public ParInterfaceDecl copy() { 083 084 try { 085 ParInterfaceDecl node = (ParInterfaceDecl) clone(); 086 node.parent = null; 087 if(children != null) 088 node.children = (ASTNode[]) children.clone(); 089 090 return node; 091 } catch (CloneNotSupportedException e) { 092 throw new Error("Error: clone not supported for " + getClass().getName()); 093 } 094 095 }/** 096 * Create a deep copy of the AST subtree at this node. 097 * The copy is dangling, i.e. has no parent. 098 * @return dangling copy of the subtree at this node 099 * @apilevel low-level 100 */ 101 @SuppressWarnings({"unchecked", "cast"}) 102 public ParInterfaceDecl fullCopy() { 103 104 ParInterfaceDecl tree = (ParInterfaceDecl) copy(); 105 if (children != null) { 106 for (int i = 0; i < children.length; ++i) { 107 switch (i) { 108 case 3: 109 case 4: 110 tree.children[i] = new List(); 111 continue; 112 } 113 ASTNode child = (ASTNode) children[i]; 114 if(child != null) { 115 child = child.fullCopy(); 116 tree.setChild(child, i); 117 } 118 } 119 } 120 return tree; 121 122 } /** 123 * @ast method 124 * @aspect GenericsNameBinding 125 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:557 126 */ 127 public void collectErrors() { 128 // Disable error check for ParInterfaceDecl which is an instanciated GenericInterfaceDecl 129 } 130 /** 131 * @ast method 132 * @aspect LookupParTypeDecl 133 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:840 134 */ 135 public TypeDecl substitute(TypeVariable typeVariable) { 136 for(int i = 0; i < numTypeParameter(); i++) 137 if(typeParameter(i) == typeVariable) 138 return getArgument(i).type(); 139 return super.substitute(typeVariable); 140 } 141 /** 142 * @ast method 143 * @aspect LookupParTypeDecl 144 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:853 145 */ 146 public int numTypeParameter() { 147 return ((GenericTypeDecl)original()).getNumTypeParameter(); 148 } 149 /** 150 * @ast method 151 * @aspect LookupParTypeDecl 152 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:856 153 */ 154 public TypeVariable typeParameter(int index) { 155 return ((GenericTypeDecl)original()).getTypeParameter(index); 156 } 157 /** 158 * @ast method 159 * @aspect LookupParTypeDecl 160 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:888 161 */ 162 public Access substitute(Parameterization parTypeDecl) { 163 // TODO: include nesting as well.... 164 if(parTypeDecl.isRawType()) 165 return ((GenericTypeDecl)genericDecl()).rawType().createBoundAccess(); 166 if(!usesTypeVariable()) 167 return super.substitute(parTypeDecl); 168 List list = new List(); 169 for(int i = 0; i < getNumArgument(); i++) 170 list.add(getArgument(i).type().substitute(parTypeDecl)); 171 return new ParTypeAccess(genericDecl().createQualifiedAccess(), list); 172 } 173 /** 174 * @ast method 175 * @aspect GenericsParTypeDecl 176 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsParTypeDecl.jrag:76 177 */ 178 public Access createQualifiedAccess() { 179 List typeArgumentList = new List(); 180 for(int i = 0; i < getNumArgument(); i++) { 181 Access a = (Access)getArgument(i); 182 if(a instanceof TypeAccess) 183 typeArgumentList.add(a.type().createQualifiedAccess()); 184 else 185 typeArgumentList.add(a.fullCopy()); 186 } 187 if(!isTopLevelType()) { 188 if(isRawType()) 189 return enclosingType().createQualifiedAccess().qualifiesAccess( 190 new TypeAccess("", getID()) 191 ); 192 else 193 return enclosingType().createQualifiedAccess().qualifiesAccess( 194 new ParTypeAccess(new TypeAccess("", getID()), typeArgumentList) 195 ); 196 } 197 else { 198 if(isRawType()) 199 return new TypeAccess(packageName(), getID()); 200 else 201 return new ParTypeAccess(new TypeAccess(packageName(), getID()), typeArgumentList); 202 } 203 } 204 /** 205 * @ast method 206 * @aspect GenericsCodegen 207 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/GenericsCodegen.jrag:300 208 */ 209 public void transformation() { 210 } 211 /** 212 * @ast method 213 * 214 */ 215 public ParInterfaceDecl() { 216 super(); 217 218 219 } 220 /** 221 * Initializes the child array to the correct size. 222 * Initializes List and Opt nta children. 223 * @apilevel internal 224 * @ast method 225 * @ast method 226 * 227 */ 228 public void init$Children() { 229 children = new ASTNode[4]; 230 setChild(new List(), 1); 231 setChild(new List(), 2); 232 setChild(new List(), 3); 233 } 234 /** 235 * @ast method 236 * 237 */ 238 public ParInterfaceDecl(Modifiers p0, String p1, List<Access> p2) { 239 setChild(p0, 0); 240 setID(p1); 241 setChild(p2, 1); 242 } 243 /** 244 * @ast method 245 * 246 */ 247 public ParInterfaceDecl(Modifiers p0, beaver.Symbol p1, List<Access> p2) { 248 setChild(p0, 0); 249 setID(p1); 250 setChild(p2, 1); 251 } 252 /** 253 * @apilevel low-level 254 * @ast method 255 * 256 */ 257 protected int numChildren() { 258 return 2; 259 } 260 /** 261 * @apilevel internal 262 * @ast method 263 * 264 */ 265 public boolean mayHaveRewrite() { 266 return false; 267 } 268 /** 269 * Replaces the Modifiers child. 270 * @param node The new node to replace the Modifiers child. 271 * @apilevel high-level 272 * @ast method 273 * 274 */ 275 public void setModifiers(Modifiers node) { 276 setChild(node, 0); 277 } 278 /** 279 * Retrieves the Modifiers child. 280 * @return The current node used as the Modifiers child. 281 * @apilevel high-level 282 * @ast method 283 * 284 */ 285 public Modifiers getModifiers() { 286 return (Modifiers)getChild(0); 287 } 288 /** 289 * Retrieves the Modifiers child. 290 * <p><em>This method does not invoke AST transformations.</em></p> 291 * @return The current node used as the Modifiers child. 292 * @apilevel low-level 293 * @ast method 294 * 295 */ 296 public Modifiers getModifiersNoTransform() { 297 return (Modifiers)getChildNoTransform(0); 298 } 299 /** 300 * Replaces the lexeme ID. 301 * @param value The new value for the lexeme ID. 302 * @apilevel high-level 303 * @ast method 304 * 305 */ 306 public void setID(String value) { 307 tokenString_ID = value; 308 } 309 /** 310 * JastAdd-internal setter for lexeme ID using the Beaver parser. 311 * @apilevel internal 312 * @ast method 313 * 314 */ 315 public void setID(beaver.Symbol symbol) { 316 if(symbol.value != null && !(symbol.value instanceof String)) 317 throw new UnsupportedOperationException("setID is only valid for String lexemes"); 318 tokenString_ID = (String)symbol.value; 319 IDstart = symbol.getStart(); 320 IDend = symbol.getEnd(); 321 } 322 /** 323 * Retrieves the value for the lexeme ID. 324 * @return The value for the lexeme ID. 325 * @apilevel high-level 326 * @ast method 327 * 328 */ 329 public String getID() { 330 return tokenString_ID != null ? tokenString_ID : ""; 331 } 332 /** 333 * Replaces the Argument list. 334 * @param list The new list node to be used as the Argument list. 335 * @apilevel high-level 336 * @ast method 337 * 338 */ 339 public void setArgumentList(List<Access> list) { 340 setChild(list, 1); 341 } 342 /** 343 * Retrieves the number of children in the Argument list. 344 * @return Number of children in the Argument list. 345 * @apilevel high-level 346 * @ast method 347 * 348 */ 349 public int getNumArgument() { 350 return getArgumentList().getNumChild(); 351 } 352 /** 353 * Retrieves the number of children in the Argument list. 354 * Calling this method will not trigger rewrites.. 355 * @return Number of children in the Argument list. 356 * @apilevel low-level 357 * @ast method 358 * 359 */ 360 public int getNumArgumentNoTransform() { 361 return getArgumentListNoTransform().getNumChildNoTransform(); 362 } 363 /** 364 * Retrieves the element at index {@code i} in the Argument list.. 365 * @param i Index of the element to return. 366 * @return The element at position {@code i} in the Argument list. 367 * @apilevel high-level 368 * @ast method 369 * 370 */ 371 @SuppressWarnings({"unchecked", "cast"}) 372 public Access getArgument(int i) { 373 return (Access)getArgumentList().getChild(i); 374 } 375 /** 376 * Append an element to the Argument list. 377 * @param node The element to append to the Argument list. 378 * @apilevel high-level 379 * @ast method 380 * 381 */ 382 public void addArgument(Access node) { 383 List<Access> list = (parent == null || state == null) ? getArgumentListNoTransform() : getArgumentList(); 384 list.addChild(node); 385 } 386 /** 387 * @apilevel low-level 388 * @ast method 389 * 390 */ 391 public void addArgumentNoTransform(Access node) { 392 List<Access> list = getArgumentListNoTransform(); 393 list.addChild(node); 394 } 395 /** 396 * Replaces the Argument list element at index {@code i} with the new node {@code node}. 397 * @param node The new node to replace the old list element. 398 * @param i The list index of the node to be replaced. 399 * @apilevel high-level 400 * @ast method 401 * 402 */ 403 public void setArgument(Access node, int i) { 404 List<Access> list = getArgumentList(); 405 list.setChild(node, i); 406 } 407 /** 408 * Retrieves the Argument list. 409 * @return The node representing the Argument list. 410 * @apilevel high-level 411 * @ast method 412 * 413 */ 414 public List<Access> getArguments() { 415 return getArgumentList(); 416 } 417 /** 418 * Retrieves the Argument list. 419 * <p><em>This method does not invoke AST transformations.</em></p> 420 * @return The node representing the Argument list. 421 * @apilevel low-level 422 * @ast method 423 * 424 */ 425 public List<Access> getArgumentsNoTransform() { 426 return getArgumentListNoTransform(); 427 } 428 /** 429 * Retrieves the Argument list. 430 * @return The node representing the Argument list. 431 * @apilevel high-level 432 * @ast method 433 * 434 */ 435 @SuppressWarnings({"unchecked", "cast"}) 436 public List<Access> getArgumentList() { 437 List<Access> list = (List<Access>)getChild(1); 438 list.getNumChild(); 439 return list; 440 } 441 /** 442 * Retrieves the Argument list. 443 * <p><em>This method does not invoke AST transformations.</em></p> 444 * @return The node representing the Argument list. 445 * @apilevel low-level 446 * @ast method 447 * 448 */ 449 @SuppressWarnings({"unchecked", "cast"}) 450 public List<Access> getArgumentListNoTransform() { 451 return (List<Access>)getChildNoTransform(1); 452 } 453 /** 454 * Replaces the SuperInterfaceId list. 455 * @param list The new list node to be used as the SuperInterfaceId list. 456 * @apilevel high-level 457 * @ast method 458 * 459 */ 460 public void setSuperInterfaceIdList(List<Access> list) { 461 setChild(list, 2); 462 } 463 /** 464 * Retrieves the number of children in the SuperInterfaceId list. 465 * @return Number of children in the SuperInterfaceId list. 466 * @apilevel high-level 467 * @ast method 468 * 469 */ 470 public int getNumSuperInterfaceId() { 471 return getSuperInterfaceIdList().getNumChild(); 472 } 473 /** 474 * Retrieves the number of children in the SuperInterfaceId list. 475 * Calling this method will not trigger rewrites.. 476 * @return Number of children in the SuperInterfaceId list. 477 * @apilevel low-level 478 * @ast method 479 * 480 */ 481 public int getNumSuperInterfaceIdNoTransform() { 482 return getSuperInterfaceIdListNoTransform().getNumChildNoTransform(); 483 } 484 /** 485 * Retrieves the element at index {@code i} in the SuperInterfaceId list.. 486 * @param i Index of the element to return. 487 * @return The element at position {@code i} in the SuperInterfaceId list. 488 * @apilevel high-level 489 * @ast method 490 * 491 */ 492 @SuppressWarnings({"unchecked", "cast"}) 493 public Access getSuperInterfaceId(int i) { 494 return (Access)getSuperInterfaceIdList().getChild(i); 495 } 496 /** 497 * Append an element to the SuperInterfaceId list. 498 * @param node The element to append to the SuperInterfaceId list. 499 * @apilevel high-level 500 * @ast method 501 * 502 */ 503 public void addSuperInterfaceId(Access node) { 504 List<Access> list = (parent == null || state == null) ? getSuperInterfaceIdListNoTransform() : getSuperInterfaceIdList(); 505 list.addChild(node); 506 } 507 /** 508 * @apilevel low-level 509 * @ast method 510 * 511 */ 512 public void addSuperInterfaceIdNoTransform(Access node) { 513 List<Access> list = getSuperInterfaceIdListNoTransform(); 514 list.addChild(node); 515 } 516 /** 517 * Replaces the SuperInterfaceId list element at index {@code i} with the new node {@code node}. 518 * @param node The new node to replace the old list element. 519 * @param i The list index of the node to be replaced. 520 * @apilevel high-level 521 * @ast method 522 * 523 */ 524 public void setSuperInterfaceId(Access node, int i) { 525 List<Access> list = getSuperInterfaceIdList(); 526 list.setChild(node, i); 527 } 528 /** 529 * Retrieves the SuperInterfaceId list. 530 * @return The node representing the SuperInterfaceId list. 531 * @apilevel high-level 532 * @ast method 533 * 534 */ 535 public List<Access> getSuperInterfaceIds() { 536 return getSuperInterfaceIdList(); 537 } 538 /** 539 * Retrieves the SuperInterfaceId list. 540 * <p><em>This method does not invoke AST transformations.</em></p> 541 * @return The node representing the SuperInterfaceId list. 542 * @apilevel low-level 543 * @ast method 544 * 545 */ 546 public List<Access> getSuperInterfaceIdsNoTransform() { 547 return getSuperInterfaceIdListNoTransform(); 548 } 549 /** 550 * Retrieves the SuperInterfaceId list. 551 * <p><em>This method does not invoke AST transformations.</em></p> 552 * @return The node representing the SuperInterfaceId list. 553 * @apilevel low-level 554 * @ast method 555 * 556 */ 557 public List<Access> getSuperInterfaceIdListNoTransform() { 558 return (List<Access>)getChildNoTransform(2); 559 } 560 /** 561 * Retrieves the child position of the SuperInterfaceId list. 562 * @return The the child position of the SuperInterfaceId list. 563 * @apilevel low-level 564 * @ast method 565 * 566 */ 567 protected int getSuperInterfaceIdListChildPosition() { 568 return 2; 569 } 570 /** 571 * Replaces the BodyDecl list. 572 * @param list The new list node to be used as the BodyDecl list. 573 * @apilevel high-level 574 * @ast method 575 * 576 */ 577 public void setBodyDeclList(List<BodyDecl> list) { 578 setChild(list, 3); 579 } 580 /** 581 * Retrieves the number of children in the BodyDecl list. 582 * @return Number of children in the BodyDecl list. 583 * @apilevel high-level 584 * @ast method 585 * 586 */ 587 public int getNumBodyDecl() { 588 return getBodyDeclList().getNumChild(); 589 } 590 /** 591 * Retrieves the number of children in the BodyDecl list. 592 * Calling this method will not trigger rewrites.. 593 * @return Number of children in the BodyDecl list. 594 * @apilevel low-level 595 * @ast method 596 * 597 */ 598 public int getNumBodyDeclNoTransform() { 599 return getBodyDeclListNoTransform().getNumChildNoTransform(); 600 } 601 /** 602 * Retrieves the element at index {@code i} in the BodyDecl list.. 603 * @param i Index of the element to return. 604 * @return The element at position {@code i} in the BodyDecl list. 605 * @apilevel high-level 606 * @ast method 607 * 608 */ 609 @SuppressWarnings({"unchecked", "cast"}) 610 public BodyDecl getBodyDecl(int i) { 611 return (BodyDecl)getBodyDeclList().getChild(i); 612 } 613 /** 614 * Append an element to the BodyDecl list. 615 * @param node The element to append to the BodyDecl list. 616 * @apilevel high-level 617 * @ast method 618 * 619 */ 620 public void addBodyDecl(BodyDecl node) { 621 List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList(); 622 list.addChild(node); 623 } 624 /** 625 * @apilevel low-level 626 * @ast method 627 * 628 */ 629 public void addBodyDeclNoTransform(BodyDecl node) { 630 List<BodyDecl> list = getBodyDeclListNoTransform(); 631 list.addChild(node); 632 } 633 /** 634 * Replaces the BodyDecl list element at index {@code i} with the new node {@code node}. 635 * @param node The new node to replace the old list element. 636 * @param i The list index of the node to be replaced. 637 * @apilevel high-level 638 * @ast method 639 * 640 */ 641 public void setBodyDecl(BodyDecl node, int i) { 642 List<BodyDecl> list = getBodyDeclList(); 643 list.setChild(node, i); 644 } 645 /** 646 * Retrieves the BodyDecl list. 647 * @return The node representing the BodyDecl list. 648 * @apilevel high-level 649 * @ast method 650 * 651 */ 652 public List<BodyDecl> getBodyDecls() { 653 return getBodyDeclList(); 654 } 655 /** 656 * Retrieves the BodyDecl list. 657 * <p><em>This method does not invoke AST transformations.</em></p> 658 * @return The node representing the BodyDecl list. 659 * @apilevel low-level 660 * @ast method 661 * 662 */ 663 public List<BodyDecl> getBodyDeclsNoTransform() { 664 return getBodyDeclListNoTransform(); 665 } 666 /** 667 * Retrieves the BodyDecl list. 668 * <p><em>This method does not invoke AST transformations.</em></p> 669 * @return The node representing the BodyDecl list. 670 * @apilevel low-level 671 * @ast method 672 * 673 */ 674 public List<BodyDecl> getBodyDeclListNoTransform() { 675 return (List<BodyDecl>)getChildNoTransform(3); 676 } 677 /** 678 * Retrieves the child position of the BodyDecl list. 679 * @return The the child position of the BodyDecl list. 680 * @apilevel low-level 681 * @ast method 682 * 683 */ 684 protected int getBodyDeclListChildPosition() { 685 return 3; 686 } 687 /** 688 * @apilevel internal 689 */ 690 protected int involvesTypeParameters_visited = -1; 691 /** 692 * @apilevel internal 693 */ 694 protected boolean involvesTypeParameters_computed = false; 695 /** 696 * @apilevel internal 697 */ 698 protected boolean involvesTypeParameters_initialized = false; 699 /** 700 * @apilevel internal 701 */ 702 protected boolean involvesTypeParameters_value; 703 /** 704 * @attribute syn 705 * @aspect GenericMethodsInference 706 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericMethodsInference.jrag:24 707 */ 708 @SuppressWarnings({"unchecked", "cast"}) 709 public boolean involvesTypeParameters() { 710 if(involvesTypeParameters_computed) { 711 return involvesTypeParameters_value; 712 } 713 ASTNode$State state = state(); 714 if (!involvesTypeParameters_initialized) { 715 involvesTypeParameters_initialized = true; 716 involvesTypeParameters_value = false; 717 } 718 if (!state.IN_CIRCLE) { 719 state.IN_CIRCLE = true; 720 int num = state.boundariesCrossed; 721 boolean isFinal = this.is$Final(); 722 do { 723 involvesTypeParameters_visited = state.CIRCLE_INDEX; 724 state.CHANGE = false; 725 boolean new_involvesTypeParameters_value = involvesTypeParameters_compute(); 726 if (new_involvesTypeParameters_value!=involvesTypeParameters_value) 727 state.CHANGE = true; 728 involvesTypeParameters_value = new_involvesTypeParameters_value; 729 state.CIRCLE_INDEX++; 730 } while (state.CHANGE); 731 if(isFinal && num == state().boundariesCrossed) { 732 involvesTypeParameters_computed = true; 733 } 734 else { 735 state.RESET_CYCLE = true; 736 involvesTypeParameters_compute(); 737 state.RESET_CYCLE = false; 738 involvesTypeParameters_computed = false; 739 involvesTypeParameters_initialized = false; 740 } 741 state.IN_CIRCLE = false; 742 return involvesTypeParameters_value; 743 } 744 if(involvesTypeParameters_visited != state.CIRCLE_INDEX) { 745 involvesTypeParameters_visited = state.CIRCLE_INDEX; 746 if (state.RESET_CYCLE) { 747 involvesTypeParameters_computed = false; 748 involvesTypeParameters_initialized = false; 749 involvesTypeParameters_visited = -1; 750 return involvesTypeParameters_value; 751 } 752 boolean new_involvesTypeParameters_value = involvesTypeParameters_compute(); 753 if (new_involvesTypeParameters_value!=involvesTypeParameters_value) 754 state.CHANGE = true; 755 involvesTypeParameters_value = new_involvesTypeParameters_value; 756 return involvesTypeParameters_value; 757 } 758 return involvesTypeParameters_value; 759 } 760 /** 761 * @apilevel internal 762 */ 763 private boolean involvesTypeParameters_compute() { 764 for(int i = 0; i < getNumArgument(); i++) 765 if(getArgument(i).type().involvesTypeParameters()) 766 return true; 767 return false; 768 } 769 /** 770 * @attribute syn 771 * @aspect NestedTypes 772 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Frontend/TypeAnalysis.jrag:569 773 */ 774 public TypeDecl hostType() { 775 ASTNode$State state = state(); 776 try { return original(); } 777 finally { 778 } 779 } 780 /** 781 * @attribute syn 782 * @aspect Generics 783 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:245 784 */ 785 public boolean isRawType() { 786 ASTNode$State state = state(); 787 try { return isNestedType() && enclosingType().isRawType(); } 788 finally { 789 } 790 } 791 /** 792 * @apilevel internal 793 */ 794 protected boolean erasure_computed = false; 795 /** 796 * @apilevel internal 797 */ 798 protected TypeDecl erasure_value; 799 /** 800 * @attribute syn 801 * @aspect GenericsErasure 802 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:351 803 */ 804 @SuppressWarnings({"unchecked", "cast"}) 805 public TypeDecl erasure() { 806 if(erasure_computed) { 807 return erasure_value; 808 } 809 ASTNode$State state = state(); 810 int num = state.boundariesCrossed; 811 boolean isFinal = this.is$Final(); 812 erasure_value = erasure_compute(); 813 if(isFinal && num == state().boundariesCrossed){ erasure_computed = true; } 814 return erasure_value; 815 } 816 /** 817 * @apilevel internal 818 */ 819 private TypeDecl erasure_compute() { return genericDecl(); } 820 /** 821 * @apilevel internal 822 */ 823 protected boolean getSuperInterfaceIdList_computed = false; 824 /** 825 * @apilevel internal 826 */ 827 protected List getSuperInterfaceIdList_value; 828 /** 829 * @attribute syn nta 830 * @aspect LookupParTypeDecl 831 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1037 832 */ 833 @SuppressWarnings({"unchecked", "cast"}) 834 public List getSuperInterfaceIdList() { 835 if(getSuperInterfaceIdList_computed) { 836 return (List) getChild(getSuperInterfaceIdListChildPosition()); 837 } 838 ASTNode$State state = state(); 839 int num = state.boundariesCrossed; 840 boolean isFinal = this.is$Final(); 841 getSuperInterfaceIdList_value = getSuperInterfaceIdList_compute(); 842 setSuperInterfaceIdList(getSuperInterfaceIdList_value); 843 if(isFinal && num == state().boundariesCrossed){ getSuperInterfaceIdList_computed = true; } 844 List node = (List) this.getChild(getSuperInterfaceIdListChildPosition()); 845 return node; 846 } 847 /** 848 * @apilevel internal 849 */ 850 private List getSuperInterfaceIdList_compute() { 851 GenericInterfaceDecl decl = (GenericInterfaceDecl)genericDecl(); 852 //System.err.println("Begin substituting implements list"); 853 List list = decl.getSuperInterfaceIdList().substitute(this); 854 //System.err.println("End substituting implements list"); 855 return list; 856 } 857 /** 858 * @apilevel internal 859 */ 860 protected boolean getBodyDeclList_computed = false; 861 /** 862 * @apilevel internal 863 */ 864 protected List getBodyDeclList_value; 865 /** 866 * @attribute syn nta 867 * @aspect LookupParTypeDecl 868 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1047 869 */ 870 @SuppressWarnings({"unchecked", "cast"}) 871 public List getBodyDeclList() { 872 if(getBodyDeclList_computed) { 873 return (List) getChild(getBodyDeclListChildPosition()); 874 } 875 ASTNode$State state = state(); 876 int num = state.boundariesCrossed; 877 boolean isFinal = this.is$Final(); 878 getBodyDeclList_value = getBodyDeclList_compute(); 879 setBodyDeclList(getBodyDeclList_value); 880 if(isFinal && num == state().boundariesCrossed){ getBodyDeclList_computed = true; } 881 List node = (List) this.getChild(getBodyDeclListChildPosition()); 882 return node; 883 } 884 /** 885 * @apilevel internal 886 */ 887 private List getBodyDeclList_compute() { return new BodyDeclList(); } 888 /** 889 * @attribute syn 890 * @aspect GenericsSubtype 891 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:14 892 */ 893 public boolean supertypeGenericClassDecl(GenericClassDecl type) { 894 ASTNode$State state = state(); 895 try { return type.subtype(genericDecl().original()); } 896 finally { 897 } 898 } 899 /** 900 * @attribute syn 901 * @aspect GenericsSubtype 902 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:20 903 */ 904 public boolean supertypeGenericInterfaceDecl(GenericInterfaceDecl type) { 905 ASTNode$State state = state(); 906 try { return type.subtype(genericDecl().original()); } 907 finally { 908 } 909 } 910 /** 911 * @attribute syn 912 * @aspect GenericsSubtype 913 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:421 914 */ 915 public boolean supertypeClassDecl(ClassDecl type) { 916 ASTNode$State state = state(); 917 try { return super.supertypeClassDecl(type); } 918 finally { 919 } 920 } 921 protected java.util.Map subtype_TypeDecl_values; 922 /** 923 * @attribute syn 924 * @aspect GenericsSubtype 925 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:128 926 */ 927 @SuppressWarnings({"unchecked", "cast"}) 928 public boolean subtype(TypeDecl type) { 929 Object _parameters = type; 930 if(subtype_TypeDecl_values == null) subtype_TypeDecl_values = new java.util.HashMap(4); 931 ASTNode$State.CircularValue _value; 932 if(subtype_TypeDecl_values.containsKey(_parameters)) { 933 Object _o = subtype_TypeDecl_values.get(_parameters); 934 if(!(_o instanceof ASTNode$State.CircularValue)) { 935 return ((Boolean)_o).booleanValue(); 936 } 937 else 938 _value = (ASTNode$State.CircularValue)_o; 939 } 940 else { 941 _value = new ASTNode$State.CircularValue(); 942 subtype_TypeDecl_values.put(_parameters, _value); 943 _value.value = Boolean.valueOf(true); 944 } 945 ASTNode$State state = state(); 946 if (!state.IN_CIRCLE) { 947 state.IN_CIRCLE = true; 948 int num = state.boundariesCrossed; 949 boolean isFinal = this.is$Final(); 950 boolean new_subtype_TypeDecl_value; 951 do { 952 _value.visited = new Integer(state.CIRCLE_INDEX); 953 state.CHANGE = false; 954 new_subtype_TypeDecl_value = subtype_compute(type); 955 if (new_subtype_TypeDecl_value!=((Boolean)_value.value).booleanValue()) { 956 state.CHANGE = true; 957 _value.value = Boolean.valueOf(new_subtype_TypeDecl_value); 958 } 959 state.CIRCLE_INDEX++; 960 } while (state.CHANGE); 961 if(isFinal && num == state().boundariesCrossed) { 962 subtype_TypeDecl_values.put(_parameters, new_subtype_TypeDecl_value); 963 } 964 else { 965 subtype_TypeDecl_values.remove(_parameters); 966 state.RESET_CYCLE = true; 967 subtype_compute(type); 968 state.RESET_CYCLE = false; 969 } 970 state.IN_CIRCLE = false; 971 return new_subtype_TypeDecl_value; 972 } 973 if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) { 974 _value.visited = new Integer(state.CIRCLE_INDEX); 975 boolean new_subtype_TypeDecl_value = subtype_compute(type); 976 if (state.RESET_CYCLE) { 977 subtype_TypeDecl_values.remove(_parameters); 978 } 979 else if (new_subtype_TypeDecl_value!=((Boolean)_value.value).booleanValue()) { 980 state.CHANGE = true; 981 _value.value = new_subtype_TypeDecl_value; 982 } 983 return new_subtype_TypeDecl_value; 984 } 985 return ((Boolean)_value.value).booleanValue(); 986 } 987 /** 988 * @apilevel internal 989 */ 990 private boolean subtype_compute(TypeDecl type) { return type.supertypeParInterfaceDecl(this); } 991 /** 992 * @attribute syn 993 * @aspect GenericsSubtype 994 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:26 995 */ 996 public boolean supertypeRawClassDecl(RawClassDecl type) { 997 ASTNode$State state = state(); 998 try { return type.genericDecl().original().subtype(genericDecl().original()); } 999 finally { 1000 } 1001 } 1002 /** 1003 * @attribute syn 1004 * @aspect GenericsSubtype 1005 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:30 1006 */ 1007 public boolean supertypeRawInterfaceDecl(RawInterfaceDecl type) { 1008 ASTNode$State state = state(); 1009 try { return type.genericDecl().original().subtype(genericDecl().original()); } 1010 finally { 1011 } 1012 } 1013 protected java.util.Map sameStructure_TypeDecl_values; 1014 /** 1015 * @attribute syn 1016 * @aspect GenericsSubtype 1017 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:194 1018 */ 1019 @SuppressWarnings({"unchecked", "cast"}) 1020 public boolean sameStructure(TypeDecl t) { 1021 Object _parameters = t; 1022 if(sameStructure_TypeDecl_values == null) sameStructure_TypeDecl_values = new java.util.HashMap(4); 1023 ASTNode$State.CircularValue _value; 1024 if(sameStructure_TypeDecl_values.containsKey(_parameters)) { 1025 Object _o = sameStructure_TypeDecl_values.get(_parameters); 1026 if(!(_o instanceof ASTNode$State.CircularValue)) { 1027 return ((Boolean)_o).booleanValue(); 1028 } 1029 else 1030 _value = (ASTNode$State.CircularValue)_o; 1031 } 1032 else { 1033 _value = new ASTNode$State.CircularValue(); 1034 sameStructure_TypeDecl_values.put(_parameters, _value); 1035 _value.value = Boolean.valueOf(true); 1036 } 1037 ASTNode$State state = state(); 1038 if (!state.IN_CIRCLE) { 1039 state.IN_CIRCLE = true; 1040 int num = state.boundariesCrossed; 1041 boolean isFinal = this.is$Final(); 1042 boolean new_sameStructure_TypeDecl_value; 1043 do { 1044 _value.visited = new Integer(state.CIRCLE_INDEX); 1045 state.CHANGE = false; 1046 new_sameStructure_TypeDecl_value = sameStructure_compute(t); 1047 if (new_sameStructure_TypeDecl_value!=((Boolean)_value.value).booleanValue()) { 1048 state.CHANGE = true; 1049 _value.value = Boolean.valueOf(new_sameStructure_TypeDecl_value); 1050 } 1051 state.CIRCLE_INDEX++; 1052 } while (state.CHANGE); 1053 if(isFinal && num == state().boundariesCrossed) { 1054 sameStructure_TypeDecl_values.put(_parameters, new_sameStructure_TypeDecl_value); 1055 } 1056 else { 1057 sameStructure_TypeDecl_values.remove(_parameters); 1058 state.RESET_CYCLE = true; 1059 sameStructure_compute(t); 1060 state.RESET_CYCLE = false; 1061 } 1062 state.IN_CIRCLE = false; 1063 return new_sameStructure_TypeDecl_value; 1064 } 1065 if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) { 1066 _value.visited = new Integer(state.CIRCLE_INDEX); 1067 boolean new_sameStructure_TypeDecl_value = sameStructure_compute(t); 1068 if (state.RESET_CYCLE) { 1069 sameStructure_TypeDecl_values.remove(_parameters); 1070 } 1071 else if (new_sameStructure_TypeDecl_value!=((Boolean)_value.value).booleanValue()) { 1072 state.CHANGE = true; 1073 _value.value = new_sameStructure_TypeDecl_value; 1074 } 1075 return new_sameStructure_TypeDecl_value; 1076 } 1077 return ((Boolean)_value.value).booleanValue(); 1078 } 1079 /** 1080 * @apilevel internal 1081 */ 1082 private boolean sameStructure_compute(TypeDecl t) { 1083 if(!(t instanceof ParInterfaceDecl)) 1084 return false; 1085 ParInterfaceDecl type = (ParInterfaceDecl)t; 1086 if(type.genericDecl().original() == genericDecl().original() && 1087 type.getNumArgument() == getNumArgument()) { 1088 for(int i = 0; i < getNumArgument(); i++) 1089 if(!type.getArgument(i).type().sameStructure(getArgument(i).type())) 1090 return false; 1091 if(isNestedType() && type.isNestedType()) 1092 return type.enclosingType().sameStructure(enclosingType()); 1093 return true; 1094 } 1095 return false; 1096 } 1097 /** 1098 * @attribute syn 1099 * @aspect GenericsSubtype 1100 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:125 1101 */ 1102 public boolean supertypeParClassDecl(ParClassDecl type) { 1103 ASTNode$State state = state(); 1104 try { 1105 if(type.genericDecl().original() == genericDecl().original() && 1106 type.getNumArgument() == getNumArgument()) { 1107 for(int i = 0; i < getNumArgument(); i++) 1108 if(!type.getArgument(i).type().containedIn(getArgument(i).type())) 1109 return false; 1110 if(isNestedType() && type.isNestedType()) 1111 return type.enclosingType().subtype(enclosingType()); 1112 return true; 1113 } 1114 return supertypeClassDecl(type); 1115 } 1116 finally { 1117 } 1118 } 1119 /** 1120 * @attribute syn 1121 * @aspect GenericsSubtype 1122 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:129 1123 */ 1124 public boolean supertypeParInterfaceDecl(ParInterfaceDecl type) { 1125 ASTNode$State state = state(); 1126 try { 1127 if(type.genericDecl().original() == genericDecl().original() && 1128 type.getNumArgument() == getNumArgument()) { 1129 for(int i = 0; i < getNumArgument(); i++) 1130 if(!type.getArgument(i).type().containedIn(getArgument(i).type())) 1131 return false; 1132 if(isNestedType() && type.isNestedType()) 1133 return type.enclosingType().subtype(enclosingType()); 1134 return true; 1135 } 1136 return supertypeInterfaceDecl(type); 1137 } 1138 finally { 1139 } 1140 } 1141 protected java.util.Map instanceOf_TypeDecl_values; 1142 /** 1143 * @attribute syn 1144 * @aspect GenericsSubtype 1145 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:398 1146 */ 1147 @SuppressWarnings({"unchecked", "cast"}) 1148 public boolean instanceOf(TypeDecl type) { 1149 Object _parameters = type; 1150 if(instanceOf_TypeDecl_values == null) instanceOf_TypeDecl_values = new java.util.HashMap(4); 1151 if(instanceOf_TypeDecl_values.containsKey(_parameters)) { 1152 return ((Boolean)instanceOf_TypeDecl_values.get(_parameters)).booleanValue(); 1153 } 1154 ASTNode$State state = state(); 1155 int num = state.boundariesCrossed; 1156 boolean isFinal = this.is$Final(); 1157 boolean instanceOf_TypeDecl_value = instanceOf_compute(type); 1158 if(isFinal && num == state().boundariesCrossed){ instanceOf_TypeDecl_values.put(_parameters, Boolean.valueOf(instanceOf_TypeDecl_value)); } 1159 return instanceOf_TypeDecl_value; 1160 } 1161 /** 1162 * @apilevel internal 1163 */ 1164 private boolean instanceOf_compute(TypeDecl type) { return subtype(type); } 1165 /** 1166 * @apilevel internal 1167 */ 1168 protected boolean typeDescriptor_computed = false; 1169 /** 1170 * @apilevel internal 1171 */ 1172 protected String typeDescriptor_value; 1173 /** 1174 * @attribute syn 1175 * @aspect GenericsCodegen 1176 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/GenericsCodegen.jrag:17 1177 */ 1178 @SuppressWarnings({"unchecked", "cast"}) 1179 public String typeDescriptor() { 1180 if(typeDescriptor_computed) { 1181 return typeDescriptor_value; 1182 } 1183 ASTNode$State state = state(); 1184 int num = state.boundariesCrossed; 1185 boolean isFinal = this.is$Final(); 1186 typeDescriptor_value = typeDescriptor_compute(); 1187 if(isFinal && num == state().boundariesCrossed){ typeDescriptor_computed = true; } 1188 return typeDescriptor_value; 1189 } 1190 /** 1191 * @apilevel internal 1192 */ 1193 private String typeDescriptor_compute() { return erasure().typeDescriptor(); } 1194 /** 1195 * @attribute syn 1196 * @aspect CreateBCode 1197 * @declaredat /home/jesper/svn/JastAddJ/Java1.4Backend/CreateBCode.jrag:820 1198 */ 1199 public String arrayTypeDescriptor() { 1200 ASTNode$State state = state(); 1201 try { return erasure().arrayTypeDescriptor(); } 1202 finally { 1203 } 1204 } 1205 /** 1206 * @apilevel internal 1207 */ 1208 protected boolean constantPoolName_computed = false; 1209 /** 1210 * @apilevel internal 1211 */ 1212 protected String constantPoolName_value; 1213 /** 1214 * @attribute syn 1215 * @aspect GenericsCodegen 1216 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/GenericsCodegen.jrag:174 1217 */ 1218 @SuppressWarnings({"unchecked", "cast"}) 1219 public String constantPoolName() { 1220 if(constantPoolName_computed) { 1221 return constantPoolName_value; 1222 } 1223 ASTNode$State state = state(); 1224 int num = state.boundariesCrossed; 1225 boolean isFinal = this.is$Final(); 1226 constantPoolName_value = constantPoolName_compute(); 1227 if(isFinal && num == state().boundariesCrossed){ constantPoolName_computed = true; } 1228 return constantPoolName_value; 1229 } 1230 /** 1231 * @apilevel internal 1232 */ 1233 private String constantPoolName_compute() { return genericDecl().constantPoolName(); } 1234 /** 1235 * @apilevel internal 1236 */ 1237 protected boolean needsSignatureAttribute_computed = false; 1238 /** 1239 * @apilevel internal 1240 */ 1241 protected boolean needsSignatureAttribute_value; 1242 /** 1243 * @attribute syn 1244 * @aspect GenericsCodegen 1245 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/GenericsCodegen.jrag:343 1246 */ 1247 @SuppressWarnings({"unchecked", "cast"}) 1248 public boolean needsSignatureAttribute() { 1249 if(needsSignatureAttribute_computed) { 1250 return needsSignatureAttribute_value; 1251 } 1252 ASTNode$State state = state(); 1253 int num = state.boundariesCrossed; 1254 boolean isFinal = this.is$Final(); 1255 needsSignatureAttribute_value = needsSignatureAttribute_compute(); 1256 if(isFinal && num == state().boundariesCrossed){ needsSignatureAttribute_computed = true; } 1257 return needsSignatureAttribute_value; 1258 } 1259 /** 1260 * @apilevel internal 1261 */ 1262 private boolean needsSignatureAttribute_compute() { return true; } 1263 /** 1264 * A type is reifiable if it either refers to a non-parameterized type, 1265 * is a raw type, is a parameterized type with only unbound wildcard 1266 * parameters or is an array type with a reifiable type parameter. 1267 * 1268 * @see "JLSv3 §4.7" 1269 * @attribute syn 1270 * @aspect SafeVarargs 1271 * @declaredat /home/jesper/svn/JastAddJ/Java7Frontend/SafeVarargs.jrag:106 1272 */ 1273 public boolean isReifiable() { 1274 ASTNode$State state = state(); 1275 try { 1276 if (isRawType()) 1277 return true; 1278 for (int i = 0; i < getNumArgument(); ++i) { 1279 if (!getArgument(i).type().isWildcard()) 1280 return false; 1281 } 1282 return true; 1283 } 1284 finally { 1285 } 1286 } 1287 /** 1288 * @attribute syn 1289 * @aspect Generics 1290 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:244 1291 */ 1292 public boolean isParameterizedType() { 1293 ASTNode$State state = state(); 1294 try { return true; } 1295 finally { 1296 } 1297 } 1298 /** 1299 * @attribute syn 1300 * @aspect GenericsTypeCheck 1301 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:380 1302 */ 1303 public boolean sameArgument(ParTypeDecl decl) { 1304 ASTNode$State state = state(); 1305 try { 1306 if(this == decl) return true; 1307 if(genericDecl() != decl.genericDecl()) 1308 return false; 1309 for(int i = 0; i < getNumArgument(); i++) { 1310 TypeDecl t1 = getArgument(i).type(); 1311 TypeDecl t2 = decl.getArgument(i).type(); 1312 if(t1 instanceof ParTypeDecl && t2 instanceof ParTypeDecl) { 1313 if(!((ParTypeDecl)t1).sameArgument((ParTypeDecl)t2)) 1314 return false; 1315 } 1316 else { 1317 if(t1 != t2) 1318 return false; 1319 } 1320 } 1321 return true; 1322 } 1323 finally { 1324 } 1325 } 1326 /** 1327 * @attribute syn 1328 * @aspect LookupParTypeDecl 1329 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:577 1330 */ 1331 public boolean sameSignature(Access a) { 1332 ASTNode$State state = state(); 1333 try { 1334 if(a instanceof ParTypeAccess) { 1335 ParTypeAccess ta = (ParTypeAccess)a; 1336 if(genericDecl() != ta.genericDecl()) 1337 return false; 1338 if(getNumArgument() != ta.getNumTypeArgument()) 1339 return false; 1340 for(int i = 0; i < getNumArgument(); i++) 1341 if(!getArgument(i).type().sameSignature(ta.getTypeArgument(i))) 1342 return false; 1343 return true; 1344 } 1345 else if(a instanceof TypeAccess && ((TypeAccess)a).isRaw()) 1346 return false; 1347 return super.sameSignature(a); 1348 } 1349 finally { 1350 } 1351 } 1352 protected java.util.Map sameSignature_ArrayList_values; 1353 /** 1354 * @attribute syn 1355 * @aspect LookupParTypeDecl 1356 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:612 1357 */ 1358 @SuppressWarnings({"unchecked", "cast"}) 1359 public boolean sameSignature(ArrayList list) { 1360 Object _parameters = list; 1361 if(sameSignature_ArrayList_values == null) sameSignature_ArrayList_values = new java.util.HashMap(4); 1362 ASTNode$State.CircularValue _value; 1363 if(sameSignature_ArrayList_values.containsKey(_parameters)) { 1364 Object _o = sameSignature_ArrayList_values.get(_parameters); 1365 if(!(_o instanceof ASTNode$State.CircularValue)) { 1366 return ((Boolean)_o).booleanValue(); 1367 } 1368 else 1369 _value = (ASTNode$State.CircularValue)_o; 1370 } 1371 else { 1372 _value = new ASTNode$State.CircularValue(); 1373 sameSignature_ArrayList_values.put(_parameters, _value); 1374 _value.value = Boolean.valueOf(true); 1375 } 1376 ASTNode$State state = state(); 1377 if (!state.IN_CIRCLE) { 1378 state.IN_CIRCLE = true; 1379 int num = state.boundariesCrossed; 1380 boolean isFinal = this.is$Final(); 1381 boolean new_sameSignature_ArrayList_value; 1382 do { 1383 _value.visited = new Integer(state.CIRCLE_INDEX); 1384 state.CHANGE = false; 1385 new_sameSignature_ArrayList_value = sameSignature_compute(list); 1386 if (new_sameSignature_ArrayList_value!=((Boolean)_value.value).booleanValue()) { 1387 state.CHANGE = true; 1388 _value.value = Boolean.valueOf(new_sameSignature_ArrayList_value); 1389 } 1390 state.CIRCLE_INDEX++; 1391 } while (state.CHANGE); 1392 if(isFinal && num == state().boundariesCrossed) { 1393 sameSignature_ArrayList_values.put(_parameters, new_sameSignature_ArrayList_value); 1394 } 1395 else { 1396 sameSignature_ArrayList_values.remove(_parameters); 1397 state.RESET_CYCLE = true; 1398 sameSignature_compute(list); 1399 state.RESET_CYCLE = false; 1400 } 1401 state.IN_CIRCLE = false; 1402 return new_sameSignature_ArrayList_value; 1403 } 1404 if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) { 1405 _value.visited = new Integer(state.CIRCLE_INDEX); 1406 boolean new_sameSignature_ArrayList_value = sameSignature_compute(list); 1407 if (state.RESET_CYCLE) { 1408 sameSignature_ArrayList_values.remove(_parameters); 1409 } 1410 else if (new_sameSignature_ArrayList_value!=((Boolean)_value.value).booleanValue()) { 1411 state.CHANGE = true; 1412 _value.value = new_sameSignature_ArrayList_value; 1413 } 1414 return new_sameSignature_ArrayList_value; 1415 } 1416 return ((Boolean)_value.value).booleanValue(); 1417 } 1418 /** 1419 * @apilevel internal 1420 */ 1421 private boolean sameSignature_compute(ArrayList list) { 1422 if(getNumArgument() != list.size()) 1423 return false; 1424 for(int i = 0; i < list.size(); i++) 1425 if(getArgument(i).type() != list.get(i)) 1426 return false; 1427 return true; 1428 } 1429 /** 1430 * @apilevel internal 1431 */ 1432 protected int usesTypeVariable_visited = -1; 1433 /** 1434 * @apilevel internal 1435 */ 1436 protected boolean usesTypeVariable_computed = false; 1437 /** 1438 * @apilevel internal 1439 */ 1440 protected boolean usesTypeVariable_initialized = false; 1441 /** 1442 * @apilevel internal 1443 */ 1444 protected boolean usesTypeVariable_value; 1445 /** 1446 * @attribute syn 1447 * @aspect LookupParTypeDecl 1448 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1069 1449 */ 1450 @SuppressWarnings({"unchecked", "cast"}) 1451 public boolean usesTypeVariable() { 1452 if(usesTypeVariable_computed) { 1453 return usesTypeVariable_value; 1454 } 1455 ASTNode$State state = state(); 1456 if (!usesTypeVariable_initialized) { 1457 usesTypeVariable_initialized = true; 1458 usesTypeVariable_value = false; 1459 } 1460 if (!state.IN_CIRCLE) { 1461 state.IN_CIRCLE = true; 1462 int num = state.boundariesCrossed; 1463 boolean isFinal = this.is$Final(); 1464 do { 1465 usesTypeVariable_visited = state.CIRCLE_INDEX; 1466 state.CHANGE = false; 1467 boolean new_usesTypeVariable_value = usesTypeVariable_compute(); 1468 if (new_usesTypeVariable_value!=usesTypeVariable_value) 1469 state.CHANGE = true; 1470 usesTypeVariable_value = new_usesTypeVariable_value; 1471 state.CIRCLE_INDEX++; 1472 } while (state.CHANGE); 1473 if(isFinal && num == state().boundariesCrossed) { 1474 usesTypeVariable_computed = true; 1475 } 1476 else { 1477 state.RESET_CYCLE = true; 1478 usesTypeVariable_compute(); 1479 state.RESET_CYCLE = false; 1480 usesTypeVariable_computed = false; 1481 usesTypeVariable_initialized = false; 1482 } 1483 state.IN_CIRCLE = false; 1484 return usesTypeVariable_value; 1485 } 1486 if(usesTypeVariable_visited != state.CIRCLE_INDEX) { 1487 usesTypeVariable_visited = state.CIRCLE_INDEX; 1488 if (state.RESET_CYCLE) { 1489 usesTypeVariable_computed = false; 1490 usesTypeVariable_initialized = false; 1491 usesTypeVariable_visited = -1; 1492 return usesTypeVariable_value; 1493 } 1494 boolean new_usesTypeVariable_value = usesTypeVariable_compute(); 1495 if (new_usesTypeVariable_value!=usesTypeVariable_value) 1496 state.CHANGE = true; 1497 usesTypeVariable_value = new_usesTypeVariable_value; 1498 return usesTypeVariable_value; 1499 } 1500 return usesTypeVariable_value; 1501 } 1502 /** 1503 * @apilevel internal 1504 */ 1505 private boolean usesTypeVariable_compute() { 1506 if(super.usesTypeVariable()) 1507 return true; 1508 for(int i = 0; i < getNumArgument(); i++) 1509 if(getArgument(i).type().usesTypeVariable()) 1510 return true; 1511 return false; 1512 } 1513 /** 1514 * @attribute syn 1515 * @aspect LookupParTypeDecl 1516 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1306 1517 */ 1518 public TypeDecl original() { 1519 ASTNode$State state = state(); 1520 try { return genericDecl().original(); } 1521 finally { 1522 } 1523 } 1524 /** 1525 * @apilevel internal 1526 */ 1527 protected boolean sourceTypeDecl_computed = false; 1528 /** 1529 * @apilevel internal 1530 */ 1531 protected TypeDecl sourceTypeDecl_value; 1532 /** 1533 * @attribute syn 1534 * @aspect SourceDeclarations 1535 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1505 1536 */ 1537 @SuppressWarnings({"unchecked", "cast"}) 1538 public TypeDecl sourceTypeDecl() { 1539 if(sourceTypeDecl_computed) { 1540 return sourceTypeDecl_value; 1541 } 1542 ASTNode$State state = state(); 1543 int num = state.boundariesCrossed; 1544 boolean isFinal = this.is$Final(); 1545 sourceTypeDecl_value = sourceTypeDecl_compute(); 1546 if(isFinal && num == state().boundariesCrossed){ sourceTypeDecl_computed = true; } 1547 return sourceTypeDecl_value; 1548 } 1549 /** 1550 * @apilevel internal 1551 */ 1552 private TypeDecl sourceTypeDecl_compute() { return genericDecl().original().sourceTypeDecl(); } 1553 /** 1554 * @apilevel internal 1555 */ 1556 protected boolean fullName_computed = false; 1557 /** 1558 * @apilevel internal 1559 */ 1560 protected String fullName_value; 1561 /** 1562 * @attribute syn 1563 * @aspect GenericsParTypeDecl 1564 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsParTypeDecl.jrag:12 1565 */ 1566 @SuppressWarnings({"unchecked", "cast"}) 1567 public String fullName() { 1568 if(fullName_computed) { 1569 return fullName_value; 1570 } 1571 ASTNode$State state = state(); 1572 int num = state.boundariesCrossed; 1573 boolean isFinal = this.is$Final(); 1574 fullName_value = fullName_compute(); 1575 if(isFinal && num == state().boundariesCrossed){ fullName_computed = true; } 1576 return fullName_value; 1577 } 1578 /** 1579 * @apilevel internal 1580 */ 1581 private String fullName_compute() { 1582 if(isNestedType()) 1583 return enclosingType().fullName() + "." + nameWithArgs(); 1584 String packageName = packageName(); 1585 if(packageName.equals("")) 1586 return nameWithArgs(); 1587 return packageName + "." + nameWithArgs(); 1588 } 1589 /** 1590 * @apilevel internal 1591 */ 1592 protected boolean typeName_computed = false; 1593 /** 1594 * @apilevel internal 1595 */ 1596 protected String typeName_value; 1597 /** 1598 * @attribute syn 1599 * @aspect GenericsParTypeDecl 1600 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsParTypeDecl.jrag:21 1601 */ 1602 @SuppressWarnings({"unchecked", "cast"}) 1603 public String typeName() { 1604 if(typeName_computed) { 1605 return typeName_value; 1606 } 1607 ASTNode$State state = state(); 1608 int num = state.boundariesCrossed; 1609 boolean isFinal = this.is$Final(); 1610 typeName_value = typeName_compute(); 1611 if(isFinal && num == state().boundariesCrossed){ typeName_computed = true; } 1612 return typeName_value; 1613 } 1614 /** 1615 * @apilevel internal 1616 */ 1617 private String typeName_compute() { 1618 if(isNestedType()) 1619 return enclosingType().typeName() + "." + nameWithArgs(); 1620 String packageName = packageName(); 1621 if(packageName.equals("") || packageName.equals(PRIMITIVE_PACKAGE_NAME)) 1622 return nameWithArgs(); 1623 return packageName + "." + nameWithArgs(); 1624 } 1625 /** 1626 * @attribute syn 1627 * @aspect GenericsParTypeDecl 1628 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsParTypeDecl.jrag:30 1629 */ 1630 public String nameWithArgs() { 1631 ASTNode$State state = state(); 1632 try { 1633 StringBuffer s = new StringBuffer(); 1634 s.append(name()); 1635 s.append("<"); 1636 for(int i = 0; i < getNumArgument(); i++) { 1637 if(i != 0) 1638 s.append(", "); 1639 s.append(getArgument(i).type().fullName()); 1640 } 1641 s.append(">"); 1642 return s.toString(); 1643 } 1644 finally { 1645 } 1646 } 1647 /** 1648 * @apilevel internal 1649 */ 1650 protected boolean unimplementedMethods_computed = false; 1651 /** 1652 * @apilevel internal 1653 */ 1654 protected Collection unimplementedMethods_value; 1655 /** 1656 * @attribute syn 1657 * @aspect MethodSignature15 1658 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/MethodSignature.jrag:406 1659 */ 1660 @SuppressWarnings({"unchecked", "cast"}) 1661 public Collection unimplementedMethods() { 1662 if(unimplementedMethods_computed) { 1663 return unimplementedMethods_value; 1664 } 1665 ASTNode$State state = state(); 1666 int num = state.boundariesCrossed; 1667 boolean isFinal = this.is$Final(); 1668 unimplementedMethods_value = unimplementedMethods_compute(); 1669 if(isFinal && num == state().boundariesCrossed){ unimplementedMethods_computed = true; } 1670 return unimplementedMethods_value; 1671 } 1672 /** 1673 * @apilevel internal 1674 */ 1675 private Collection unimplementedMethods_compute() { 1676 HashSet set = new HashSet(); 1677 HashSet result = new HashSet(); 1678 for(Iterator iter = genericDecl().unimplementedMethods().iterator(); iter.hasNext(); ) { 1679 MethodDecl m = (MethodDecl)iter.next(); 1680 set.add(m.sourceMethodDecl()); 1681 } 1682 for(Iterator iter = super.unimplementedMethods().iterator(); iter.hasNext(); ) { 1683 MethodDecl m = (MethodDecl)iter.next(); 1684 if(set.contains(m.sourceMethodDecl())) 1685 result.add(m); 1686 } 1687 return result; 1688 } 1689 /** 1690 * @apilevel internal 1691 */ 1692 protected boolean uniqueIndex_computed = false; 1693 /** 1694 * @apilevel internal 1695 */ 1696 protected int uniqueIndex_value; 1697 /** 1698 * @attribute syn 1699 * @aspect GenericsCodegen 1700 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/GenericsCodegen.jrag:33 1701 */ 1702 @SuppressWarnings({"unchecked", "cast"}) 1703 public int uniqueIndex() { 1704 if(uniqueIndex_computed) { 1705 return uniqueIndex_value; 1706 } 1707 ASTNode$State state = state(); 1708 int num = state.boundariesCrossed; 1709 boolean isFinal = this.is$Final(); 1710 uniqueIndex_value = uniqueIndex_compute(); 1711 if(isFinal && num == state().boundariesCrossed){ uniqueIndex_computed = true; } 1712 return uniqueIndex_value; 1713 } 1714 /** 1715 * @apilevel internal 1716 */ 1717 private int uniqueIndex_compute() { return genericDecl().uniqueIndex(); } 1718 /** 1719 * @attribute syn 1720 * @aspect GenericsCodegen 1721 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Backend/GenericsCodegen.jrag:470 1722 */ 1723 public String typeArgumentsOpt() { 1724 ASTNode$State state = state(); 1725 try { 1726 StringBuffer buf = new StringBuffer(); 1727 buf.append("<"); 1728 for(int i = 0; i < getNumArgument(); i++) 1729 buf.append(getArgument(i).type().fieldTypeSignature()); 1730 buf.append(">"); 1731 return buf.toString(); 1732 } 1733 finally { 1734 } 1735 } 1736 /** 1737 * @apilevel internal 1738 */ 1739 protected boolean localMethodsSignatureMap_computed = false; 1740 /** 1741 * @apilevel internal 1742 */ 1743 protected HashMap localMethodsSignatureMap_value; 1744 /** 1745 * @attribute syn 1746 * @aspect LookupParTypeDecl 1747 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1084 1748 */ 1749 @SuppressWarnings({"unchecked", "cast"}) 1750 public HashMap localMethodsSignatureMap() { 1751 if(localMethodsSignatureMap_computed) { 1752 return localMethodsSignatureMap_value; 1753 } 1754 ASTNode$State state = state(); 1755 int num = state.boundariesCrossed; 1756 boolean isFinal = this.is$Final(); 1757 localMethodsSignatureMap_value = localMethodsSignatureMap_compute(); 1758 if(true){ localMethodsSignatureMap_computed = true; } 1759 return localMethodsSignatureMap_value; 1760 } 1761 /** 1762 * @apilevel internal 1763 */ 1764 private HashMap localMethodsSignatureMap_compute() { 1765 HashMap map = new HashMap(); 1766 for(Iterator iter = original().localMethodsIterator(); iter.hasNext(); ) { 1767 MethodDecl decl = (MethodDecl)iter.next(); 1768 1769 /* ES removing this: 1770 if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) { 1771 BodyDecl b = decl.substitutedBodyDecl(this); 1772 addBodyDecl(b); 1773 // Here we should access b through an ordinary 1774 // child accessor instead of setting is$Final directly, 1775 // however doing so appears to cause unexpected behaviour! 1776 b.is$Final = true; 1777 decl = (MethodDecl) b; 1778 } 1779 map.put(decl.signature(), decl); 1780 * and replacing with: 1781 */ 1782 if(!decl.isStatic() && (decl.usesTypeVariable() || isRawType())) { 1783 BodyDecl copyDecl = ((BodyDeclList)getBodyDeclList()).localMethodSignatureCopy(decl, this); 1784 decl = (MethodDecl) copyDecl; 1785 } 1786 map.put(decl.signature(), decl); 1787 1788 } 1789 return map; 1790 } 1791 protected java.util.Map localFields_String_values; 1792 /** 1793 * @attribute syn 1794 * @aspect LookupParTypeDecl 1795 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1119 1796 */ 1797 @SuppressWarnings({"unchecked", "cast"}) 1798 public SimpleSet localFields(String name) { 1799 Object _parameters = name; 1800 if(localFields_String_values == null) localFields_String_values = new java.util.HashMap(4); 1801 if(localFields_String_values.containsKey(_parameters)) { 1802 return (SimpleSet)localFields_String_values.get(_parameters); 1803 } 1804 ASTNode$State state = state(); 1805 int num = state.boundariesCrossed; 1806 boolean isFinal = this.is$Final(); 1807 SimpleSet localFields_String_value = localFields_compute(name); 1808 if(true){ localFields_String_values.put(_parameters, localFields_String_value); } 1809 return localFields_String_value; 1810 } 1811 /** 1812 * @apilevel internal 1813 */ 1814 private SimpleSet localFields_compute(String name) { 1815 SimpleSet set = SimpleSet.emptySet; 1816 for(Iterator iter = original().localFields(name).iterator(); iter.hasNext(); ) { 1817 FieldDeclaration f = (FieldDeclaration)iter.next(); 1818 1819 /* ES removing this: 1820 if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) { 1821 BodyDecl b = f.substitutedBodyDecl(this); 1822 addBodyDecl(b); 1823 // Here we should access b through an ordinary 1824 // child accessor instead of setting is$Final directly, 1825 // however doing so appears to cause unexpected behaviour! 1826 b.is$Final = true; 1827 f = (FieldDeclaration) b; 1828 } 1829 set = set.add(f); 1830 * and replacing with: 1831 */ 1832 if(!f.isStatic() && (f.usesTypeVariable() || isRawType())) { 1833 BodyDecl fCopy = ((BodyDeclList)getBodyDeclList()).localFieldCopy(f, this); 1834 f = (FieldDeclaration) fCopy; 1835 } 1836 set = set.add(f); 1837 1838 } 1839 return set; 1840 } 1841 protected java.util.Map localTypeDecls_String_values; 1842 /** 1843 * @attribute syn 1844 * @aspect LookupParTypeDecl 1845 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1154 1846 */ 1847 @SuppressWarnings({"unchecked", "cast"}) 1848 public SimpleSet localTypeDecls(String name) { 1849 Object _parameters = name; 1850 if(localTypeDecls_String_values == null) localTypeDecls_String_values = new java.util.HashMap(4); 1851 ASTNode$State.CircularValue _value; 1852 if(localTypeDecls_String_values.containsKey(_parameters)) { 1853 Object _o = localTypeDecls_String_values.get(_parameters); 1854 if(!(_o instanceof ASTNode$State.CircularValue)) { 1855 return (SimpleSet)_o; 1856 } 1857 else 1858 _value = (ASTNode$State.CircularValue)_o; 1859 } 1860 else { 1861 _value = new ASTNode$State.CircularValue(); 1862 localTypeDecls_String_values.put(_parameters, _value); 1863 _value.value = SimpleSet.emptySet; 1864 } 1865 ASTNode$State state = state(); 1866 if (!state.IN_CIRCLE) { 1867 state.IN_CIRCLE = true; 1868 int num = state.boundariesCrossed; 1869 boolean isFinal = this.is$Final(); 1870 SimpleSet new_localTypeDecls_String_value; 1871 do { 1872 _value.visited = new Integer(state.CIRCLE_INDEX); 1873 state.CHANGE = false; 1874 new_localTypeDecls_String_value = localTypeDecls_compute(name); 1875 if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) { 1876 state.CHANGE = true; 1877 _value.value = new_localTypeDecls_String_value; 1878 } 1879 state.CIRCLE_INDEX++; 1880 } while (state.CHANGE); 1881 if(true) { 1882 localTypeDecls_String_values.put(_parameters, new_localTypeDecls_String_value); 1883 } 1884 else { 1885 localTypeDecls_String_values.remove(_parameters); 1886 state.RESET_CYCLE = true; 1887 localTypeDecls_compute(name); 1888 state.RESET_CYCLE = false; 1889 } 1890 state.IN_CIRCLE = false; 1891 return new_localTypeDecls_String_value; 1892 } 1893 if(!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) { 1894 _value.visited = new Integer(state.CIRCLE_INDEX); 1895 SimpleSet new_localTypeDecls_String_value = localTypeDecls_compute(name); 1896 if (state.RESET_CYCLE) { 1897 localTypeDecls_String_values.remove(_parameters); 1898 } 1899 else if ((new_localTypeDecls_String_value==null && (SimpleSet)_value.value!=null) || (new_localTypeDecls_String_value!=null && !new_localTypeDecls_String_value.equals((SimpleSet)_value.value))) { 1900 state.CHANGE = true; 1901 _value.value = new_localTypeDecls_String_value; 1902 } 1903 return new_localTypeDecls_String_value; 1904 } 1905 return (SimpleSet)_value.value; 1906 } 1907 /** 1908 * @apilevel internal 1909 */ 1910 private SimpleSet localTypeDecls_compute(String name) { 1911 SimpleSet set = SimpleSet.emptySet; 1912 for(Iterator iter = original().localTypeDecls(name).iterator(); iter.hasNext(); ) { 1913 TypeDecl t = (TypeDecl)iter.next(); 1914 1915 /* ES: removing this: 1916 if(t.isStatic()) 1917 set = set.add(t); 1918 else { 1919 BodyDecl b; 1920 TypeDecl typeDecl; 1921 if(t instanceof ClassDecl) { 1922 ClassDecl classDecl = (ClassDecl)t; 1923 typeDecl = classDecl.substitutedClassDecl(this); 1924 b = new MemberClassDecl((ClassDecl)typeDecl); 1925 addBodyDecl(b); 1926 // Here we should access b through an ordinary 1927 // child accessor instead of setting is$Final directly, 1928 // however doing so appears to cause unexpected behaviour! 1929 b.is$Final = true; 1930 set = set.add(typeDecl); 1931 } 1932 else if(t instanceof InterfaceDecl) { 1933 InterfaceDecl interfaceDecl = (InterfaceDecl)t; 1934 typeDecl = interfaceDecl.substitutedInterfaceDecl(this); 1935 b = new MemberInterfaceDecl((InterfaceDecl)typeDecl); 1936 addBodyDecl(b); 1937 // Here we should access b through an ordinary 1938 // child accessor instead of setting is$Final directly, 1939 // however doing so appears to cause unexpected behaviour! 1940 b.is$Final = true; 1941 set = set.add(typeDecl); 1942 } 1943 } 1944 * and replacing with: 1945 */ 1946 if(t.isStatic()) { 1947 set = set.add(t); 1948 } else if (t instanceof ClassDecl) { 1949 MemberClassDecl copy = ((BodyDeclList)getBodyDeclList()).localClassDeclCopy((ClassDecl)t, this); 1950 set = set.add(copy.getClassDecl()); 1951 } else if (t instanceof InterfaceDecl) { 1952 MemberInterfaceDecl copy = ((BodyDeclList)getBodyDeclList()).localInterfaceDeclCopy((InterfaceDecl)t, this); 1953 set = set.add(copy.getInterfaceDecl()); 1954 } 1955 } 1956 return set; 1957 } 1958 /** 1959 * @apilevel internal 1960 */ 1961 protected boolean constructors_computed = false; 1962 /** 1963 * @apilevel internal 1964 */ 1965 protected Collection constructors_value; 1966 /** 1967 * @attribute syn 1968 * @aspect LookupParTypeDecl 1969 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:1213 1970 */ 1971 @SuppressWarnings({"unchecked", "cast"}) 1972 public Collection constructors() { 1973 if(constructors_computed) { 1974 return constructors_value; 1975 } 1976 ASTNode$State state = state(); 1977 int num = state.boundariesCrossed; 1978 boolean isFinal = this.is$Final(); 1979 constructors_value = constructors_compute(); 1980 if(isFinal && num == state().boundariesCrossed){ constructors_computed = true; } 1981 return constructors_value; 1982 } 1983 /** 1984 * @apilevel internal 1985 */ 1986 private Collection constructors_compute() { 1987 Collection set = new ArrayList(); 1988 for(Iterator iter = original().constructors().iterator(); iter.hasNext(); ) { 1989 ConstructorDecl c = (ConstructorDecl)iter.next(); 1990 1991 /* ES: removing this: 1992 BodyDecl b = c.substitutedBodyDecl(this); 1993 addBodyDecl(b); 1994 // Here we should access b through an ordinary 1995 // child accessor instead of setting is$Final directly, 1996 // however doing so appears to cause unexpected behaviour! 1997 b.is$Final = true; 1998 * and replacing with: 1999 */ 2000 BodyDecl b = ((BodyDeclList)getBodyDeclList()).constructorCopy(c, this); 2001 set.add(b); 2002 } 2003 return set; 2004 } 2005 /** 2006 * @apilevel internal 2007 */ 2008 protected boolean genericDecl_computed = false; 2009 /** 2010 * @apilevel internal 2011 */ 2012 protected TypeDecl genericDecl_value; 2013 /** 2014 * @attribute inh 2015 * @aspect GenericsParTypeDecl 2016 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsParTypeDecl.jrag:45 2017 */ 2018 @SuppressWarnings({"unchecked", "cast"}) 2019 public TypeDecl genericDecl() { 2020 if(genericDecl_computed) { 2021 return genericDecl_value; 2022 } 2023 ASTNode$State state = state(); 2024 int num = state.boundariesCrossed; 2025 boolean isFinal = this.is$Final(); 2026 genericDecl_value = getParent().Define_TypeDecl_genericDecl(this, null); 2027 if(isFinal && num == state().boundariesCrossed){ genericDecl_computed = true; } 2028 return genericDecl_value; 2029 } 2030 /** 2031 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/Generics.jrag:477 2032 * @apilevel internal 2033 */ 2034 public NameType Define_NameType_nameType(ASTNode caller, ASTNode child) { 2035 if(caller == getArgumentListNoTransform()) { 2036 int childIndex = caller.getIndexOfChild(child); 2037 return NameType.TYPE_NAME; 2038 } 2039 else { return super.Define_NameType_nameType(caller, child); 2040 } 2041 } 2042 /** 2043 * @declaredat /home/jesper/svn/JastAddJ/Java1.5Frontend/GenericsParTypeDecl.jrag:59 2044 * @apilevel internal 2045 */ 2046 public TypeDecl Define_TypeDecl_genericDecl(ASTNode caller, ASTNode child) { 2047 if(caller == getBodyDeclListNoTransform()) { 2048 int index = caller.getIndexOfChild(child); 2049 { 2050 if(getBodyDecl(index) instanceof MemberTypeDecl) { 2051 MemberTypeDecl m = (MemberTypeDecl)getBodyDecl(index); 2052 return extractSingleType(genericDecl().memberTypes(m.typeDecl().name())); 2053 } 2054 return genericDecl(); 2055 } 2056 } 2057 else { return getParent().Define_TypeDecl_genericDecl(this, caller); 2058 } 2059 } 2060 /** 2061 * @apilevel internal 2062 */ 2063 public ASTNode rewriteTo() { 2064 return super.rewriteTo(); 2065 } 2066 }