Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

KnownMessageSend.java 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v 2.0
  6. * which accompanies this distribution and is available at
  7. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.ajdt.internal.compiler.ast;
  13. import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
  14. import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MessageSend;
  15. import org.aspectj.org.eclipse.jdt.internal.compiler.codegen.CodeStream;
  16. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
  17. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
  18. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
  19. public class KnownMessageSend extends MessageSend {
  20. public KnownMessageSend(MethodBinding binding, Expression receiver, Expression[] arguments) {
  21. super();
  22. this.binding = binding;
  23. this.arguments = arguments;
  24. this.receiver = receiver;
  25. this.actualReceiverType = binding.declaringClass;
  26. this.selector = binding.selector;
  27. // 1.8.7 change:
  28. // If we don't set this to NotAConstant then we run the code in MessageSend.resolveType that sorts
  29. // out this.argumentTypes - which we need set because further down MessageSend.resolveType it will
  30. // attempt to use it.
  31. // constant = Constant.NotAConstant;
  32. }
  33. public void manageSyntheticAccessIfNecessary(BlockScope currentScope) {
  34. return;
  35. }
  36. protected void resolveMethodBinding(
  37. BlockScope scope,
  38. TypeBinding[] argumentTypes) {
  39. // we've already resolved this
  40. }
  41. public String toStringExpression() {
  42. return "KnownMessageSend";
  43. }
  44. public void generateCode(
  45. BlockScope currentScope,
  46. CodeStream codeStream,
  47. boolean valueRequired) {
  48. //System.out.println("about to generate: " +this + " args: " + Arrays.asList(arguments));
  49. // this.actualReceiverType = this.receiver.resolveType(currentScope);
  50. super.generateCode(currentScope, codeStream, valueRequired);
  51. }
  52. }