blob: e7f8557867fa455e6396348f86356452bbe1de59 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Inter-type method declarations and method dispatch</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJTM 5 Development Kit Developer's Notebook"><link rel="up" href="autoboxing.html" title="Chapter 4. Autoboxing and Unboxing"><link rel="previous" href="autoboxing-in-aspectj5.html" title="Autoboxing and Join Point matching in AspectJ 5"><link rel="next" href="covariance.html" title="Chapter 5. Covariance"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Inter-type method declarations and method dispatch</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="autoboxing-in-aspectj5.html">Prev</a>&nbsp;</td><th width="60%" align="center">Chapter 4. Autoboxing and Unboxing</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="covariance.html">Next</a></td></tr></table><hr></div><div class="sect1"><a name="autoboxing-and-method-dispatch"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="autoboxing-and-method-dispatch"></a>Inter-type method declarations and method dispatch</h2></div></div><p>Autoboxing, unboxing, and also varargs all affect the method
dispatch algorithm used in Java 5. In AspectJ 5, the target method
of a call is selected according to the following algorithm:</p><div class="orderedlist"><ol type="1"><li><a name="d0e3139"></a>Attempt to locate a matching method or inter-type declared
method without considering
autoboxing, unboxing, or vararg invocations.</li><li><a name="d0e3141"></a>If no match is found, try again considering autoboxing
and unboxing.</li><li><a name="d0e3143"></a>Finally try again considering both autoboxing, unboxing,
and varargs.</li></ol></div><p>One consequence is that a directly matching inter-type declared
method will take precedence over a method declared locally in the
target class but that only matches via autoboxing.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="autoboxing-in-aspectj5.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="covariance.html">Next</a></td></tr><tr><td width="40%" align="left">Autoboxing and Join Point matching in AspectJ 5&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="autoboxing.html">Up</a></td><td width="40%" align="right">&nbsp;Chapter 5. Covariance</td></tr></table></div></body></html>