Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] no match for this type name...

The message is correct because it is perfectly legal
(though often a mistake)
to specify a type name in a pointcut that is not matched
in the currently-available types.  By contrast, it is
an error for a Java class reference to be unresolved.
So the failure/error case is different from Java's,
even though the solution in some cases is to add the
import statement.  The message points this out by
refering to type-matching, which is discussed in the
Programming Guide.

More generally, the AspectJ project does aim to extend
rather than change Java for precisely the reasons you
mentioned.  However, it's often clearer to strongly
distinguish things that might look similar in Java,
to avoid developers confusing the two situations.

Wes

Michael McConnell wrote:

Ramnivas -- At first I thought you were being sarcastic when you wrote:


For the error message, how about something like:
"Unknown type MessageCommunicator. Please ensure correct spelling and/or the type is visible to the source file (check your import statements or use the fully-qualified type name)".


And then I saw the following:

The downside I see is sheer verbosity of the message.
Perhaps a better alternative is to point to document
that elaborates on "Xlint:invalidAbsoluteTypeName".


I think the latter is much more preferable than the former. But I think *BOTH* miss the
point that I was trying to make earlier, which is: if I were using standard Java
(with/without Eclipse), and I had forgotten the package statement, I would have gotten
the following message: "The declared package does not match the expected package xxxxx".
NOT the statement:  "no match for this type name: XXXX [Xlint:invalidAbsoluteTypeName]".

I mean --- this is almost as good as a 1970's ABEND NNNN statement.

In your book, you state that ajc is a superset of javac. Which is fine as far as it goes,
but (I wish the AJC developers had decided to) add in the syntax and semantics that AOP
requires, but *don't mess with standard java*, especially the error messages and warnings
that you would expect to see if *writing standard Java*. If the package and import
statements are valid within an aspect, treat them as they would a standard Java
statement, and issue the standard messages we have all grown to know and love.

NONE of this is YOUR FAULT. However, there was a suggestion on this forum to start
documenting errors like as to probable causes. As much as it would have helped me, I
would prefer that aspect users get together and start demanding tools from ajc developers
that build upon the knowledge that they already know, and do not require
learning/generating differential diagnoses for symptoms they have never seen.
FWTW,
Michael


=====



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ _______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top