001 /* This file was generated with JastAdd2 (http://jastadd.org) version 2.1.13-12-g880e696 */ 002 package org.extendj.ast; 003 004 import java.util.HashSet; 005 import java.io.File; 006 import java.util.Set; 007 import java.util.Collections; 008 import java.util.Collection; 009 import java.util.ArrayList; 010 import beaver.*; 011 import java.util.*; 012 import java.io.ByteArrayOutputStream; 013 import java.io.PrintStream; 014 import java.lang.reflect.InvocationTargetException; 015 import java.lang.reflect.Method; 016 import org.jastadd.util.*; 017 import java.util.zip.*; 018 import java.io.*; 019 import org.jastadd.util.PrettyPrintable; 020 import org.jastadd.util.PrettyPrinter; 021 import java.io.FileNotFoundException; 022 import java.io.BufferedInputStream; 023 import java.io.DataInputStream; 024 /** 025 * @ast node 026 * @declaredat /home/jesper/git/extendj/java5/grammar/GenericMethods.ast:7 027 * @production ParMethodDecl : {@link MethodDecl} ::= <span class="component">TypeArgument:{@link Access}*</span> <span class="component"><GenericMethodDecl:GenericMethodDecl></span>; 028 029 */ 030 public class ParMethodDecl extends MethodDecl implements Cloneable, Parameterization { 031 /** 032 * @aspect TypeCheck 033 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericMethods.jrag:121 034 */ 035 public void collectErrors() { 036 } 037 /** 038 * @aspect LookupParTypeDecl 039 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:968 040 */ 041 public TypeDecl substitute(TypeVariable typeVariable) { 042 for (int i = 0; i < numTypeParameter(); i++) { 043 if (typeParameter(i) == typeVariable) { 044 return getTypeArgument(i).type(); 045 } 046 } 047 return genericMethodDecl().hostType().substitute(typeVariable); 048 } 049 /** 050 * @aspect LookupParTypeDecl 051 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1001 052 */ 053 public boolean isRawType() { 054 return false; 055 } 056 /** 057 * @aspect LookupParTypeDecl 058 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1009 059 */ 060 public int numTypeParameter() { 061 return genericMethodDecl().original().getNumTypeParameter(); 062 } 063 /** 064 * @aspect LookupParTypeDecl 065 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1017 066 */ 067 public TypeVariable typeParameter(int index) { 068 return genericMethodDecl().original().getTypeParameter(index); 069 } 070 /** 071 * @aspect GenericsCodegen 072 * @declaredat /home/jesper/git/extendj/java5/backend/GenericsCodegen.jrag:217 073 */ 074 public void transformation() { } 075 /** 076 * A raw type parameterization. Performs no substitutions. 077 * @aspect MethodSignature15 078 * @declaredat /home/jesper/git/extendj/java5/frontend/MethodSignature.jrag:240 079 */ 080 public static final Parameterization RAW = new Parameterization() { 081 @Override 082 public boolean isRawType() { 083 return true; 084 } 085 @Override 086 public TypeDecl substitute(TypeVariable typeVariable) { 087 return typeVariable; 088 } 089 }; 090 /** 091 * @declaredat ASTNode:1 092 */ 093 public ParMethodDecl() { 094 super(); 095 } 096 /** 097 * Initializes the child array to the correct size. 098 * Initializes List and Opt nta children. 099 * @apilevel internal 100 * @ast method 101 * @declaredat ASTNode:10 102 */ 103 public void init$Children() { 104 children = new ASTNode[6]; 105 setChild(new List(), 2); 106 setChild(new List(), 3); 107 setChild(new Opt(), 4); 108 setChild(new List(), 5); 109 } 110 /** 111 * @declaredat ASTNode:17 112 */ 113 public ParMethodDecl(Modifiers p0, Access p1, String p2, List<ParameterDeclaration> p3, List<Access> p4, Opt<Block> p5, List<Access> p6, GenericMethodDecl p7) { 114 setChild(p0, 0); 115 setChild(p1, 1); 116 setID(p2); 117 setChild(p3, 2); 118 setChild(p4, 3); 119 setChild(p5, 4); 120 setChild(p6, 5); 121 setGenericMethodDecl(p7); 122 } 123 /** 124 * @declaredat ASTNode:27 125 */ 126 public ParMethodDecl(Modifiers p0, Access p1, beaver.Symbol p2, List<ParameterDeclaration> p3, List<Access> p4, Opt<Block> p5, List<Access> p6, GenericMethodDecl p7) { 127 setChild(p0, 0); 128 setChild(p1, 1); 129 setID(p2); 130 setChild(p3, 2); 131 setChild(p4, 3); 132 setChild(p5, 4); 133 setChild(p6, 5); 134 setGenericMethodDecl(p7); 135 } 136 /** 137 * @apilevel low-level 138 * @declaredat ASTNode:40 139 */ 140 protected int numChildren() { 141 return 6; 142 } 143 /** 144 * @apilevel internal 145 * @declaredat ASTNode:46 146 */ 147 public boolean mayHaveRewrite() { 148 return false; 149 } 150 /** 151 * @apilevel internal 152 * @declaredat ASTNode:52 153 */ 154 public void flushAttrCache() { 155 super.flushAttrCache(); 156 genericMethodDecl_reset(); 157 sourceMethodDecl_reset(); 158 lessSpecificThan_MethodDecl_reset(); 159 } 160 /** 161 * @apilevel internal 162 * @declaredat ASTNode:61 163 */ 164 public void flushCollectionCache() { 165 super.flushCollectionCache(); 166 } 167 /** 168 * @apilevel internal 169 * @declaredat ASTNode:67 170 */ 171 public void flushRewriteCache() { 172 super.flushRewriteCache(); 173 } 174 /** 175 * @apilevel internal 176 * @declaredat ASTNode:73 177 */ 178 public ParMethodDecl clone() throws CloneNotSupportedException { 179 ParMethodDecl node = (ParMethodDecl) super.clone(); 180 return node; 181 } 182 /** 183 * @apilevel internal 184 * @declaredat ASTNode:80 185 */ 186 public ParMethodDecl copy() { 187 try { 188 ParMethodDecl node = (ParMethodDecl) clone(); 189 node.parent = null; 190 if (children != null) { 191 node.children = (ASTNode[]) children.clone(); 192 } 193 return node; 194 } catch (CloneNotSupportedException e) { 195 throw new Error("Error: clone not supported for " + getClass().getName()); 196 } 197 } 198 /** 199 * Create a deep copy of the AST subtree at this node. 200 * The copy is dangling, i.e. has no parent. 201 * @return dangling copy of the subtree at this node 202 * @apilevel low-level 203 * @deprecated Please use treeCopy or treeCopyNoTransform instead 204 * @declaredat ASTNode:99 205 */ 206 @Deprecated 207 public ParMethodDecl fullCopy() { 208 return treeCopyNoTransform(); 209 } 210 /** 211 * Create a deep copy of the AST subtree at this node. 212 * The copy is dangling, i.e. has no parent. 213 * @return dangling copy of the subtree at this node 214 * @apilevel low-level 215 * @declaredat ASTNode:109 216 */ 217 public ParMethodDecl treeCopyNoTransform() { 218 ParMethodDecl tree = (ParMethodDecl) copy(); 219 if (children != null) { 220 for (int i = 0; i < children.length; ++i) { 221 ASTNode child = (ASTNode) children[i]; 222 if (child != null) { 223 child = child.treeCopyNoTransform(); 224 tree.setChild(child, i); 225 } 226 } 227 } 228 return tree; 229 } 230 /** 231 * Create a deep copy of the AST subtree at this node. 232 * The subtree of this node is traversed to trigger rewrites before copy. 233 * The copy is dangling, i.e. has no parent. 234 * @return dangling copy of the subtree at this node 235 * @apilevel low-level 236 * @declaredat ASTNode:129 237 */ 238 public ParMethodDecl treeCopy() { 239 doFullTraversal(); 240 return treeCopyNoTransform(); 241 } 242 /** 243 * @apilevel internal 244 * @declaredat ASTNode:136 245 */ 246 protected boolean is$Equal(ASTNode node) { 247 return super.is$Equal(node) && (tokenString_ID == ((ParMethodDecl)node).tokenString_ID) && (tokenGenericMethodDecl_GenericMethodDecl == ((ParMethodDecl)node).tokenGenericMethodDecl_GenericMethodDecl); 248 } 249 /** 250 * Replaces the Modifiers child. 251 * @param node The new node to replace the Modifiers child. 252 * @apilevel high-level 253 */ 254 public void setModifiers(Modifiers node) { 255 setChild(node, 0); 256 } 257 /** 258 * Retrieves the Modifiers child. 259 * @return The current node used as the Modifiers child. 260 * @apilevel high-level 261 */ 262 @ASTNodeAnnotation.Child(name="Modifiers") 263 public Modifiers getModifiers() { 264 return (Modifiers) getChild(0); 265 } 266 /** 267 * Retrieves the Modifiers child. 268 * <p><em>This method does not invoke AST transformations.</em></p> 269 * @return The current node used as the Modifiers child. 270 * @apilevel low-level 271 */ 272 public Modifiers getModifiersNoTransform() { 273 return (Modifiers) getChildNoTransform(0); 274 } 275 /** 276 * Replaces the TypeAccess child. 277 * @param node The new node to replace the TypeAccess child. 278 * @apilevel high-level 279 */ 280 public void setTypeAccess(Access node) { 281 setChild(node, 1); 282 } 283 /** 284 * Retrieves the TypeAccess child. 285 * @return The current node used as the TypeAccess child. 286 * @apilevel high-level 287 */ 288 @ASTNodeAnnotation.Child(name="TypeAccess") 289 public Access getTypeAccess() { 290 return (Access) getChild(1); 291 } 292 /** 293 * Retrieves the TypeAccess child. 294 * <p><em>This method does not invoke AST transformations.</em></p> 295 * @return The current node used as the TypeAccess child. 296 * @apilevel low-level 297 */ 298 public Access getTypeAccessNoTransform() { 299 return (Access) getChildNoTransform(1); 300 } 301 /** 302 * Replaces the lexeme ID. 303 * @param value The new value for the lexeme ID. 304 * @apilevel high-level 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 * @param symbol Symbol containing the new value for the lexeme ID 312 * @apilevel internal 313 */ 314 public void setID(beaver.Symbol symbol) { 315 if (symbol.value != null && !(symbol.value instanceof String)) 316 throw new UnsupportedOperationException("setID is only valid for String lexemes"); 317 tokenString_ID = (String)symbol.value; 318 IDstart = symbol.getStart(); 319 IDend = symbol.getEnd(); 320 } 321 /** 322 * Retrieves the value for the lexeme ID. 323 * @return The value for the lexeme ID. 324 * @apilevel high-level 325 */ 326 @ASTNodeAnnotation.Token(name="ID") 327 public String getID() { 328 return tokenString_ID != null ? tokenString_ID : ""; 329 } 330 /** 331 * Replaces the Parameter list. 332 * @param list The new list node to be used as the Parameter list. 333 * @apilevel high-level 334 */ 335 public void setParameterList(List<ParameterDeclaration> list) { 336 setChild(list, 2); 337 } 338 /** 339 * Retrieves the number of children in the Parameter list. 340 * @return Number of children in the Parameter list. 341 * @apilevel high-level 342 */ 343 public int getNumParameter() { 344 return getParameterList().getNumChild(); 345 } 346 /** 347 * Retrieves the number of children in the Parameter list. 348 * Calling this method will not trigger rewrites. 349 * @return Number of children in the Parameter list. 350 * @apilevel low-level 351 */ 352 public int getNumParameterNoTransform() { 353 return getParameterListNoTransform().getNumChildNoTransform(); 354 } 355 /** 356 * Retrieves the element at index {@code i} in the Parameter list. 357 * @param i Index of the element to return. 358 * @return The element at position {@code i} in the Parameter list. 359 * @apilevel high-level 360 */ 361 public ParameterDeclaration getParameter(int i) { 362 return (ParameterDeclaration) getParameterList().getChild(i); 363 } 364 /** 365 * Check whether the Parameter list has any children. 366 * @return {@code true} if it has at least one child, {@code false} otherwise. 367 * @apilevel high-level 368 */ 369 public boolean hasParameter() { 370 return getParameterList().getNumChild() != 0; 371 } 372 /** 373 * Append an element to the Parameter list. 374 * @param node The element to append to the Parameter list. 375 * @apilevel high-level 376 */ 377 public void addParameter(ParameterDeclaration node) { 378 List<ParameterDeclaration> list = (parent == null) ? getParameterListNoTransform() : getParameterList(); 379 list.addChild(node); 380 } 381 /** 382 * @apilevel low-level 383 */ 384 public void addParameterNoTransform(ParameterDeclaration node) { 385 List<ParameterDeclaration> list = getParameterListNoTransform(); 386 list.addChild(node); 387 } 388 /** 389 * Replaces the Parameter list element at index {@code i} with the new node {@code node}. 390 * @param node The new node to replace the old list element. 391 * @param i The list index of the node to be replaced. 392 * @apilevel high-level 393 */ 394 public void setParameter(ParameterDeclaration node, int i) { 395 List<ParameterDeclaration> list = getParameterList(); 396 list.setChild(node, i); 397 } 398 /** 399 * Retrieves the Parameter list. 400 * @return The node representing the Parameter list. 401 * @apilevel high-level 402 */ 403 @ASTNodeAnnotation.ListChild(name="Parameter") 404 public List<ParameterDeclaration> getParameterList() { 405 List<ParameterDeclaration> list = (List<ParameterDeclaration>) getChild(2); 406 return list; 407 } 408 /** 409 * Retrieves the Parameter list. 410 * <p><em>This method does not invoke AST transformations.</em></p> 411 * @return The node representing the Parameter list. 412 * @apilevel low-level 413 */ 414 public List<ParameterDeclaration> getParameterListNoTransform() { 415 return (List<ParameterDeclaration>) getChildNoTransform(2); 416 } 417 /** 418 * Retrieves the Parameter list. 419 * @return The node representing the Parameter list. 420 * @apilevel high-level 421 */ 422 public List<ParameterDeclaration> getParameters() { 423 return getParameterList(); 424 } 425 /** 426 * Retrieves the Parameter list. 427 * <p><em>This method does not invoke AST transformations.</em></p> 428 * @return The node representing the Parameter list. 429 * @apilevel low-level 430 */ 431 public List<ParameterDeclaration> getParametersNoTransform() { 432 return getParameterListNoTransform(); 433 } 434 /** 435 * Replaces the Exception list. 436 * @param list The new list node to be used as the Exception list. 437 * @apilevel high-level 438 */ 439 public void setExceptionList(List<Access> list) { 440 setChild(list, 3); 441 } 442 /** 443 * Retrieves the number of children in the Exception list. 444 * @return Number of children in the Exception list. 445 * @apilevel high-level 446 */ 447 public int getNumException() { 448 return getExceptionList().getNumChild(); 449 } 450 /** 451 * Retrieves the number of children in the Exception list. 452 * Calling this method will not trigger rewrites. 453 * @return Number of children in the Exception list. 454 * @apilevel low-level 455 */ 456 public int getNumExceptionNoTransform() { 457 return getExceptionListNoTransform().getNumChildNoTransform(); 458 } 459 /** 460 * Retrieves the element at index {@code i} in the Exception list. 461 * @param i Index of the element to return. 462 * @return The element at position {@code i} in the Exception list. 463 * @apilevel high-level 464 */ 465 public Access getException(int i) { 466 return (Access) getExceptionList().getChild(i); 467 } 468 /** 469 * Check whether the Exception list has any children. 470 * @return {@code true} if it has at least one child, {@code false} otherwise. 471 * @apilevel high-level 472 */ 473 public boolean hasException() { 474 return getExceptionList().getNumChild() != 0; 475 } 476 /** 477 * Append an element to the Exception list. 478 * @param node The element to append to the Exception list. 479 * @apilevel high-level 480 */ 481 public void addException(Access node) { 482 List<Access> list = (parent == null) ? getExceptionListNoTransform() : getExceptionList(); 483 list.addChild(node); 484 } 485 /** 486 * @apilevel low-level 487 */ 488 public void addExceptionNoTransform(Access node) { 489 List<Access> list = getExceptionListNoTransform(); 490 list.addChild(node); 491 } 492 /** 493 * Replaces the Exception list element at index {@code i} with the new node {@code node}. 494 * @param node The new node to replace the old list element. 495 * @param i The list index of the node to be replaced. 496 * @apilevel high-level 497 */ 498 public void setException(Access node, int i) { 499 List<Access> list = getExceptionList(); 500 list.setChild(node, i); 501 } 502 /** 503 * Retrieves the Exception list. 504 * @return The node representing the Exception list. 505 * @apilevel high-level 506 */ 507 @ASTNodeAnnotation.ListChild(name="Exception") 508 public List<Access> getExceptionList() { 509 List<Access> list = (List<Access>) getChild(3); 510 return list; 511 } 512 /** 513 * Retrieves the Exception list. 514 * <p><em>This method does not invoke AST transformations.</em></p> 515 * @return The node representing the Exception list. 516 * @apilevel low-level 517 */ 518 public List<Access> getExceptionListNoTransform() { 519 return (List<Access>) getChildNoTransform(3); 520 } 521 /** 522 * Retrieves the Exception list. 523 * @return The node representing the Exception list. 524 * @apilevel high-level 525 */ 526 public List<Access> getExceptions() { 527 return getExceptionList(); 528 } 529 /** 530 * Retrieves the Exception list. 531 * <p><em>This method does not invoke AST transformations.</em></p> 532 * @return The node representing the Exception list. 533 * @apilevel low-level 534 */ 535 public List<Access> getExceptionsNoTransform() { 536 return getExceptionListNoTransform(); 537 } 538 /** 539 * Replaces the optional node for the Block child. This is the <code>Opt</code> 540 * node containing the child Block, not the actual child! 541 * @param opt The new node to be used as the optional node for the Block child. 542 * @apilevel low-level 543 */ 544 public void setBlockOpt(Opt<Block> opt) { 545 setChild(opt, 4); 546 } 547 /** 548 * Replaces the (optional) Block child. 549 * @param node The new node to be used as the Block child. 550 * @apilevel high-level 551 */ 552 public void setBlock(Block node) { 553 getBlockOpt().setChild(node, 0); 554 } 555 /** 556 * Check whether the optional Block child exists. 557 * @return {@code true} if the optional Block child exists, {@code false} if it does not. 558 * @apilevel high-level 559 */ 560 public boolean hasBlock() { 561 return getBlockOpt().getNumChild() != 0; 562 } 563 /** 564 * Retrieves the (optional) Block child. 565 * @return The Block child, if it exists. Returns {@code null} otherwise. 566 * @apilevel low-level 567 */ 568 public Block getBlock() { 569 return (Block) getBlockOpt().getChild(0); 570 } 571 /** 572 * Retrieves the optional node for the Block child. This is the <code>Opt</code> node containing the child Block, not the actual child! 573 * @return The optional node for child the Block child. 574 * @apilevel low-level 575 */ 576 @ASTNodeAnnotation.OptChild(name="Block") 577 public Opt<Block> getBlockOpt() { 578 return (Opt<Block>) getChild(4); 579 } 580 /** 581 * Retrieves the optional node for child Block. This is the <code>Opt</code> node containing the child Block, not the actual child! 582 * <p><em>This method does not invoke AST transformations.</em></p> 583 * @return The optional node for child Block. 584 * @apilevel low-level 585 */ 586 public Opt<Block> getBlockOptNoTransform() { 587 return (Opt<Block>) getChildNoTransform(4); 588 } 589 /** 590 * Replaces the TypeArgument list. 591 * @param list The new list node to be used as the TypeArgument list. 592 * @apilevel high-level 593 */ 594 public void setTypeArgumentList(List<Access> list) { 595 setChild(list, 5); 596 } 597 /** 598 * Retrieves the number of children in the TypeArgument list. 599 * @return Number of children in the TypeArgument list. 600 * @apilevel high-level 601 */ 602 public int getNumTypeArgument() { 603 return getTypeArgumentList().getNumChild(); 604 } 605 /** 606 * Retrieves the number of children in the TypeArgument list. 607 * Calling this method will not trigger rewrites. 608 * @return Number of children in the TypeArgument list. 609 * @apilevel low-level 610 */ 611 public int getNumTypeArgumentNoTransform() { 612 return getTypeArgumentListNoTransform().getNumChildNoTransform(); 613 } 614 /** 615 * Retrieves the element at index {@code i} in the TypeArgument list. 616 * @param i Index of the element to return. 617 * @return The element at position {@code i} in the TypeArgument list. 618 * @apilevel high-level 619 */ 620 public Access getTypeArgument(int i) { 621 return (Access) getTypeArgumentList().getChild(i); 622 } 623 /** 624 * Check whether the TypeArgument list has any children. 625 * @return {@code true} if it has at least one child, {@code false} otherwise. 626 * @apilevel high-level 627 */ 628 public boolean hasTypeArgument() { 629 return getTypeArgumentList().getNumChild() != 0; 630 } 631 /** 632 * Append an element to the TypeArgument list. 633 * @param node The element to append to the TypeArgument list. 634 * @apilevel high-level 635 */ 636 public void addTypeArgument(Access node) { 637 List<Access> list = (parent == null) ? getTypeArgumentListNoTransform() : getTypeArgumentList(); 638 list.addChild(node); 639 } 640 /** 641 * @apilevel low-level 642 */ 643 public void addTypeArgumentNoTransform(Access node) { 644 List<Access> list = getTypeArgumentListNoTransform(); 645 list.addChild(node); 646 } 647 /** 648 * Replaces the TypeArgument list element at index {@code i} with the new node {@code node}. 649 * @param node The new node to replace the old list element. 650 * @param i The list index of the node to be replaced. 651 * @apilevel high-level 652 */ 653 public void setTypeArgument(Access node, int i) { 654 List<Access> list = getTypeArgumentList(); 655 list.setChild(node, i); 656 } 657 /** 658 * Retrieves the TypeArgument list. 659 * @return The node representing the TypeArgument list. 660 * @apilevel high-level 661 */ 662 @ASTNodeAnnotation.ListChild(name="TypeArgument") 663 public List<Access> getTypeArgumentList() { 664 List<Access> list = (List<Access>) getChild(5); 665 return list; 666 } 667 /** 668 * Retrieves the TypeArgument list. 669 * <p><em>This method does not invoke AST transformations.</em></p> 670 * @return The node representing the TypeArgument list. 671 * @apilevel low-level 672 */ 673 public List<Access> getTypeArgumentListNoTransform() { 674 return (List<Access>) getChildNoTransform(5); 675 } 676 /** 677 * Retrieves the TypeArgument list. 678 * @return The node representing the TypeArgument list. 679 * @apilevel high-level 680 */ 681 public List<Access> getTypeArguments() { 682 return getTypeArgumentList(); 683 } 684 /** 685 * Retrieves the TypeArgument list. 686 * <p><em>This method does not invoke AST transformations.</em></p> 687 * @return The node representing the TypeArgument list. 688 * @apilevel low-level 689 */ 690 public List<Access> getTypeArgumentsNoTransform() { 691 return getTypeArgumentListNoTransform(); 692 } 693 /** 694 * Replaces the lexeme GenericMethodDecl. 695 * @param value The new value for the lexeme GenericMethodDecl. 696 * @apilevel high-level 697 */ 698 public void setGenericMethodDecl(GenericMethodDecl value) { 699 tokenGenericMethodDecl_GenericMethodDecl = value; 700 } 701 /** 702 * @apilevel internal 703 */ 704 protected GenericMethodDecl tokenGenericMethodDecl_GenericMethodDecl; 705 /** 706 * Retrieves the value for the lexeme GenericMethodDecl. 707 * @return The value for the lexeme GenericMethodDecl. 708 * @apilevel high-level 709 */ 710 @ASTNodeAnnotation.Token(name="GenericMethodDecl") 711 public GenericMethodDecl getGenericMethodDecl() { 712 return tokenGenericMethodDecl_GenericMethodDecl; 713 } 714 /** 715 * @apilevel internal 716 */ 717 protected boolean genericMethodDecl_computed = false; 718 /** 719 * @apilevel internal 720 */ 721 protected GenericMethodDecl genericMethodDecl_value; 722 /** 723 * @apilevel internal 724 */ 725 private void genericMethodDecl_reset() { 726 genericMethodDecl_computed = false; 727 genericMethodDecl_value = null; 728 } 729 /** 730 * @attribute syn 731 * @aspect GenericMethods 732 * @declaredat /home/jesper/git/extendj/java5/frontend/GenericMethods.jrag:51 733 */ 734 @ASTNodeAnnotation.Attribute 735 public GenericMethodDecl genericMethodDecl() { 736 ASTNode$State state = state(); 737 if (genericMethodDecl_computed) { 738 return genericMethodDecl_value; 739 } 740 boolean intermediate = state.INTERMEDIATE_VALUE; 741 state.INTERMEDIATE_VALUE = false; 742 int num = state.boundariesCrossed; 743 boolean isFinal = this.is$Final(); 744 genericMethodDecl_value = getGenericMethodDecl(); 745 if (isFinal && num == state().boundariesCrossed) { 746 genericMethodDecl_computed = true; 747 } else { 748 } 749 state.INTERMEDIATE_VALUE |= intermediate; 750 751 return genericMethodDecl_value; 752 } 753 /** 754 * @attribute syn 755 * @aspect LookupParTypeDecl 756 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1413 757 */ 758 @ASTNodeAnnotation.Attribute 759 public MethodDecl erasedMethod() { 760 MethodDecl erasedMethod_value = genericMethodDecl().erasedMethod(); 761 762 return erasedMethod_value; 763 } 764 /** 765 * @apilevel internal 766 */ 767 protected boolean sourceMethodDecl_computed = false; 768 /** 769 * @apilevel internal 770 */ 771 protected MethodDecl sourceMethodDecl_value; 772 /** 773 * @apilevel internal 774 */ 775 private void sourceMethodDecl_reset() { 776 sourceMethodDecl_computed = false; 777 sourceMethodDecl_value = null; 778 } 779 /** 780 * @attribute syn 781 * @aspect SourceDeclarations 782 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1625 783 */ 784 @ASTNodeAnnotation.Attribute 785 public MethodDecl sourceMethodDecl() { 786 ASTNode$State state = state(); 787 if (sourceMethodDecl_computed) { 788 return sourceMethodDecl_value; 789 } 790 boolean intermediate = state.INTERMEDIATE_VALUE; 791 state.INTERMEDIATE_VALUE = false; 792 int num = state.boundariesCrossed; 793 boolean isFinal = this.is$Final(); 794 sourceMethodDecl_value = genericMethodDecl().original().sourceMethodDecl(); 795 if (isFinal && num == state().boundariesCrossed) { 796 sourceMethodDecl_computed = true; 797 } else { 798 } 799 state.INTERMEDIATE_VALUE |= intermediate; 800 801 return sourceMethodDecl_value; 802 } 803 /** 804 * @apilevel internal 805 */ 806 protected java.util.Map lessSpecificThan_MethodDecl_values; 807 /** 808 * @apilevel internal 809 */ 810 private void lessSpecificThan_MethodDecl_reset() { 811 lessSpecificThan_MethodDecl_values = null; 812 } 813 /** 814 * Caution: a less specific than b does not mean b is not less specific than a! 815 * @param m argument method to compare to 816 * @return {@code true} if any parameter of this method decl is not a 817 * subtype (non-proper subtype) of the corresponding parameter of the 818 * argument method 819 * @attribute syn 820 * @aspect MethodDecl 821 * @declaredat /home/jesper/git/extendj/java4/frontend/LookupMethod.jrag:235 822 */ 823 @ASTNodeAnnotation.Attribute 824 public boolean lessSpecificThan(MethodDecl m) { 825 Object _parameters = m; 826 if (lessSpecificThan_MethodDecl_values == null) lessSpecificThan_MethodDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap()); 827 ASTNode$State state = state(); 828 if (lessSpecificThan_MethodDecl_values.containsKey(_parameters)) { 829 return (Boolean) lessSpecificThan_MethodDecl_values.get(_parameters); 830 } 831 boolean intermediate = state.INTERMEDIATE_VALUE; 832 state.INTERMEDIATE_VALUE = false; 833 int num = state.boundariesCrossed; 834 boolean isFinal = this.is$Final(); 835 boolean lessSpecificThan_MethodDecl_value = genericMethodDecl().lessSpecificThan(m instanceof ParMethodDecl 836 ? ((ParMethodDecl) m).genericMethodDecl() : m ); 837 if (isFinal && num == state().boundariesCrossed) { 838 lessSpecificThan_MethodDecl_values.put(_parameters, lessSpecificThan_MethodDecl_value); 839 } else { 840 } 841 state.INTERMEDIATE_VALUE |= intermediate; 842 843 return lessSpecificThan_MethodDecl_value; 844 } 845 /** 846 * @apilevel internal 847 */ 848 public ASTNode rewriteTo() { 849 return super.rewriteTo(); 850 } 851 }