What do .. and * mean in aspectj

倾然丶 夕夏残阳落幕 提交于 2019-12-05 06:38:50

This is from AspectJ site: http://www.eclipse.org/aspectj/doc/next/progguide/semantics-pointcuts.html

* represents any number of characters except "."

.. represents any number of characters including any number of "."

Update From AspectJ in Action - for method signatures:

In method signatures, the wildcard .. is used to denote any type and number of arguments taken by a method

* specifies a single argument

Others have answered part of the question before me, so I will only amend:

.., bla, .. does not work because if you bind parameter bla to a variable there might be several matching combinations in case a matching type occurs multiple times in the parameter list. Example:

void foo(int a, String b, String c, File d)

Now what should happen if the advice is:

before(String bla) : call(void foo(.., bla, ..)) && args(bla)

Should bla be bound to the String value of b or c?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!