Skip to main content



      Home
Home » Language IDEs » AspectJ » How to include/exclude basic types in pointcuts?
How to include/exclude basic types in pointcuts? [message #586454] Mon, 07 February 2005 16:09
Eclipse UserFriend
Hi all,
our application creates some datastructure that need to be
java.io.Serializable (we use that format to transfer the data to
another system and then deserialize it there).

To make sure we do not inadvertedly refer to any non-serializable,
non-transient fields I wrote the below aspect to yield a compile error
if we do:

----------------------
import java.io.Serializable;

public aspect SerializableCheck
{
pointcut nonSerializableAccesses():
set (!transient !Serializable+ foo.bar.*.*);

declare error:
nonSerializableAccesses()
&& !adviceexecution()
: "use of non-serializable field!";
}
----------------------

This aspect in principle seems to work, at least it already pointed me
out, that at some point we were using a Map - which indeed is not
serializable (only some implementations of the Map-interface are, but
not all!) - but now I am stuck, since I get many errors in statements
that refer to basic types (like boolean, int, float, ...). I thought
these were "java.io.Serializable" by definition, aren't they!?!

Probably these fields are treated special in the compiler anyway,
since there is no "Class" associated with them and hence the check
whether they implement the Serializable interface fails. But then one
would need some mechanism in the AspectJ language to exclude these
basic types from such pointcuts. Can one do that?

Any ideas or suggestion how to tackle this? Or should I file yet
another bug-/feature-request?

Cheers,
Michael
Previous Topic:link to AspectJ 5 Developer's Notebook is dangling
Next Topic:link to AspectJ 5 Developer's Notebook is dangling
Goto Forum:
  


Current Time: Mon Jun 23 00:10:28 EDT 2025

Powered by FUDForum. Page generated in 0.06610 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top