You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

KnownMessageSend.java 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  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.impl.Constant;
  17. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
  18. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
  19. import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
  20. public class KnownMessageSend extends MessageSend {
  21. public KnownMessageSend(MethodBinding binding, Expression receiver, Expression[] arguments) {
  22. super();
  23. this.binding = binding;
  24. this.arguments = arguments;
  25. this.receiver = receiver;
  26. this.actualReceiverType = binding.declaringClass;
  27. this.selector = binding.selector;
  28. // 1.8.7 change:
  29. // If we don't set this to NotAConstant then we run the code in MessageSend.resolveType that sorts
  30. // out this.argumentTypes - which we need set because further down MessageSend.resolveType it will
  31. // attempt to use it.
  32. // constant = Constant.NotAConstant;
  33. }
  34. public void manageSyntheticAccessIfNecessary(BlockScope currentScope) {
  35. return;
  36. }
  37. protected void resolveMethodBinding(
  38. BlockScope scope,
  39. TypeBinding[] argumentTypes) {
  40. // we've already resolved this
  41. }
  42. public String toStringExpression() {
  43. return "KnownMessageSend";
  44. }
  45. public void generateCode(
  46. BlockScope currentScope,
  47. CodeStream codeStream,
  48. boolean valueRequired) {
  49. //System.out.println("about to generate: " +this + " args: " + Arrays.asList(arguments));
  50. // this.actualReceiverType = this.receiver.resolveType(currentScope);
  51. super.generateCode(currentScope, codeStream, valueRequired);
  52. }
  53. }