equal
deleted
inserted
replaced
579 // Set m.params |
579 // Set m.params |
580 ListBuffer<VarSymbol> params = new ListBuffer<VarSymbol>(); |
580 ListBuffer<VarSymbol> params = new ListBuffer<VarSymbol>(); |
581 JCVariableDecl lastParam = null; |
581 JCVariableDecl lastParam = null; |
582 for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) { |
582 for (List<JCVariableDecl> l = tree.params; l.nonEmpty(); l = l.tail) { |
583 JCVariableDecl param = lastParam = l.head; |
583 JCVariableDecl param = lastParam = l.head; |
584 assert param.sym != null; |
584 params.append(Assert.checkNonNull(param.sym)); |
585 params.append(param.sym); |
|
586 } |
585 } |
587 m.params = params.toList(); |
586 m.params = params.toList(); |
588 |
587 |
589 // mark the method varargs, if necessary |
588 // mark the method varargs, if necessary |
590 if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0) |
589 if (lastParam != null && (lastParam.mods.flags & Flags.VARARGS) != 0) |
697 /* ******************************************************************** |
696 /* ******************************************************************** |
698 * Type completion |
697 * Type completion |
699 *********************************************************************/ |
698 *********************************************************************/ |
700 |
699 |
701 Type attribImportType(JCTree tree, Env<AttrContext> env) { |
700 Type attribImportType(JCTree tree, Env<AttrContext> env) { |
702 assert completionEnabled; |
701 Assert.check(completionEnabled); |
703 try { |
702 try { |
704 // To prevent deep recursion, suppress completion of some |
703 // To prevent deep recursion, suppress completion of some |
705 // types. |
704 // types. |
706 completionEnabled = false; |
705 completionEnabled = false; |
707 return attr.attribType(tree, env); |
706 return attr.attribType(tree, env); |
723 annotate.later(new Annotate.Annotator() { |
722 annotate.later(new Annotate.Annotator() { |
724 public String toString() { |
723 public String toString() { |
725 return "annotate " + annotations + " onto " + s + " in " + s.owner; |
724 return "annotate " + annotations + " onto " + s + " in " + s.owner; |
726 } |
725 } |
727 public void enterAnnotation() { |
726 public void enterAnnotation() { |
728 assert s.kind == PCK || s.attributes_field == null; |
727 Assert.check(s.kind == PCK || s.attributes_field == null); |
729 JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile); |
728 JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile); |
730 try { |
729 try { |
731 if (s.attributes_field != null && |
730 if (s.attributes_field != null && |
732 s.attributes_field.nonEmpty() && |
731 s.attributes_field.nonEmpty() && |
733 annotations.nonEmpty()) |
732 annotations.nonEmpty()) |
834 */ |
833 */ |
835 public void complete(Symbol sym) throws CompletionFailure { |
834 public void complete(Symbol sym) throws CompletionFailure { |
836 // Suppress some (recursive) MemberEnter invocations |
835 // Suppress some (recursive) MemberEnter invocations |
837 if (!completionEnabled) { |
836 if (!completionEnabled) { |
838 // Re-install same completer for next time around and return. |
837 // Re-install same completer for next time around and return. |
839 assert (sym.flags() & Flags.COMPOUND) == 0; |
838 Assert.check((sym.flags() & Flags.COMPOUND) == 0); |
840 sym.completer = this; |
839 sym.completer = this; |
841 return; |
840 return; |
842 } |
841 } |
843 |
842 |
844 ClassSymbol c = (ClassSymbol)sym; |
843 ClassSymbol c = (ClassSymbol)sym; |