blob: 0b088fd1eb2ac57d489c5acd867f11d5fb80ee1e [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Chapter 1. Messages</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 Problem Diagnosis Guide"><link rel="up" href="index.html" title="The AspectJtm Problem Diagnosis Guide"><link rel="previous" href="index.html" title="The AspectJtm Problem Diagnosis Guide"><link rel="next" href="messages-scenarios.html" title="Message scenarios"></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">Chapter 1. Messages</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="messages-scenarios.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="messages"></a>Chapter 1. Messages</h2></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="messages.html#messages-introduction">Introduction</a></dt><dd><dl><dt><a href="messages.html#messages-introduction-config">Configuring Messages</a></dt></dl></dd><dt><a href="messages-scenarios.html">Message scenarios</a></dt><dd><dl><dt><a href="messages-scenarios.html#messages-scenarios-ct">Compile-time weaving scenarios</a></dt><dt><a href="messages-scenarios.html#messages-scenarios-ltw">Load-time weaving scenarios</a></dt></dl></dd><dt><a href="messages-xlint.html">Lint messages</a></dt></dl></div><div class="sect1"><a name="messages-introduction"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="messages-introduction"></a>Introduction</h2></div></div><p>
Messages point out potential problems in the input program; some
are clearly problems (errors), but many more may depend on what
the programmer intends. To keep the noise down the latter are treated
as warnings which can be ignored by the programmer or information
which are hidden. However, when investigating
unexpected behavior it's helpful to show them. This section describes how
to configure messages, presents some problem scenarios when
compiling or doing load-time weaving, and summarizes some of the
more relevant messages.
</p><div class="sect2"><a name="messages-introduction-config"></a><div class="titlepage"><div><h3 class="title"><a name="messages-introduction-config"></a>Configuring Messages</h3></div></div><p>
The compiler offers <tt>-verbose</tt>,
<tt>-warning</tt>, and <tt>-XLint</tt> options
when invoked using the command-line, Ant, or embedded in an IDE.
All options are listed in the AspectJ Development Environment Guide
sections for
<a href="../devguide/ajc-ref.html" target="_top">Ajc</a> and
<a href="../devguide/antTasks-iajc.html" target="_top">Ant Tasks</a>.
The <a href="../devguide/ltw.html" target="_top">Load-time Weaving</a>
section describes how to use XML configuration files and
system properties to pass options to the weaver. (You can also
pass options to the weaver using system properties in build-
time weaving.)
The <tt>-verbose</tt> option has the effect of including
messages level "info", which are normally ignored.
Both <tt>warning</tt> and <tt>XLint</tt>
enable you to identify specific messages to emit, but warning
messages tend to be the same provided by the underlying Eclipse
JDT (Java) compiler, while XLint messages are emitted by the
AspectJ compiler or weaver. Obviously, during load-time weaving
only weaver messages will be emitted. Similarly, if aspects
are compiled but not woven, then only compiler messages will be
emitted. However, the usual case for the compiler/weaver working
at build time is to emit both compiler and weaver messages.
</p><p> The tables below list some options, System Properties (for LTW only) and Java 5 annotations
used to control AspectJ messages. The method
of configuration depends on your environment so please refer to the relevant
documentation for
<a href="../devguide/ajc-ref.html" target="_top">ajc</a>,
<a href="../devguide/antTasks.html" target="_top">Ant</a> or
<a href="../devguide/ltw-configuration.html#weaver-options" target="_top">LTW</a>.
</p><p>
<div class="informaltable" id="d0e95"><a name="d0e95"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Option</th><th>Description</th></tr></thead><tbody><tr><td><tt>-verbose</tt></td><td>
Show informational messages including AspectJ version
and build date.
</td></tr><tr><td><tt>-debug</tt></td><td>
(Load-time weaving only). Show debugging messages such as
which classes are being woven or those that are excluded.
(This is not related to the compiler -g option to
include debug information in the output .class files.)
</td></tr><tr><td><tt>-showWeaveInfo</tt></td><td>
Show weaving messages.
</td></tr><tr><td><tt>-Xlint</tt></td><td>
Control level of lint messages.
</td></tr><tr><td><tt>messageHolderClass</tt>/
<tt>-XmessageHolderClass:</tt></td><td>
In Ant tasks and LTW respectively specify the class to receive all messages.
See
<a href="../devguide/antTasks-iajc.html#antTasks-iajc-options" target="_top">
iajc task options</a> or
<a href="../devguide/ltw-configuration.html#weaver-options" target="_top">
Weaver Options</a>.
</td></tr></tbody></table></div>
</p><p>
<div class="informaltable" id="d0e147"><a name="d0e147"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>System Property</th><th>Description</th></tr></thead><tbody><tr><td><tt>aj.weaving.verbose</tt></td><td>
Show informational messages including AspectJ version and build date
(same as <tt>-verbose</tt> option).
</td></tr><tr><td><tt>org.aspectj.weaver.showWeaveInfo</tt></td><td>
Show weaving messages
(same as <tt>-showWeaveInfo</tt> option).
</td></tr><tr><td><tt>org.aspectj.weaving.messages</tt></td><td>
Set this system property to enable tracing of all compiler
messages. See <a href="trace.html#trace-configuration">Configuring Tracing</a>.
</td></tr></tbody></table></div>
</p><p>
<div class="informaltable" id="d0e185"><a name="d0e185"></a><table border="1"><colgroup><col><col></colgroup><thead><tr><th>Annotation</th><th>Description</th></tr></thead><tbody><tr><td><tt>@SuppressAjWarnings</tt></td><td>
Include this is Java 5 code to suppress AspectJ
warnings associated with the next line of code.
</td></tr></tbody></table></div>
</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.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="messages-scenarios.html">Next</a></td></tr><tr><td width="40%" align="left">The AspectJ<sup>tm</sup> Problem Diagnosis Guide&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right">&nbsp;Message scenarios</td></tr></table></div></body></html>