Browse Source

Rephrase docs for WeavingXmlConfig::excludesType

and turn into javadoc.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
tags/V1_9_21_2
Alexander Kriegisch 2 months ago
parent
commit
4b93b6867d

+ 1
- 1
docs/devguide/ltw.adoc View File

then all non-excluded aspects are included. then all non-excluded aspects are included.
* The set of types to be woven are those types matched by at least one * The set of types to be woven are those types matched by at least one
weaver `include` element and not matched by any weaver `exclude` weaver `include` element and not matched by any weaver `exclude`
element. If there are no weaver include statements then all non-excluded
element. If there are no weaver include statements, then all non-excluded
types are included. types are included.
* The weaver options are derived by taking the union of the options * The weaver options are derived by taking the union of the options
specified in each of the weaver options attribute specifications. Where specified in each of the weaver options attribute specifications. Where

+ 17
- 7
weaver/src/main/java/org/aspectj/weaver/bcel/BcelWorld.java View File

if (!world.getMessageHandler().isIgnoring(IMessage.INFO)) { if (!world.getMessageHandler().isIgnoring(IMessage.INFO)) {
world.getMessageHandler().handleMessage( world.getMessageHandler().handleMessage(
MessageUtil.info("Aspect '" + aspectName + "' is scoped to apply against types matching pattern '" MessageUtil.info("Aspect '" + aspectName + "' is scoped to apply against types matching pattern '"
+ scopePattern.toString() + "'"));
+ scopePattern + "'"));
} }
} catch (Exception e) { } catch (Exception e) {
world.getMessageHandler().handleMessage( world.getMessageHandler().handleMessage(
return scopes.get(name); return scopes.get(name);
} }


// Can't quite follow the same rules for exclusion as used for loadtime weaving:
// "The set of types to be woven are those types matched by at least one weaver include element and not matched by any
// weaver
// exclude element. If there are no weaver include statements then all non-excluded types are included."
// Since if the weaver is seeing it during this kind of build, the type is implicitly included. So all we should check
// for is exclusion
/**
* Checks if a given type is to be excluded from weaving.
* <p>
* For LTW, the development guide (<i>docs/devguide/ltw.adoc</i>) says:
* <p>
* <i>"The set of types to be woven are those types matched by at least one weaver {@code include} element and not
* matched by any weaver {@code exclude} element. If there are no weaver include statements, then all non-excluded
* types are included."</i>
* <p>
* In CTW mode, we cannot quite follow the same rules for exclusion as used for LTW: If the weaver is seeing it
* during this kind of build, the type is implicitly included. So all we should check for is exclusion.
*
* @param type resolved type to be checked
*
* @return Always false in LTW mode. In CTW mode true for excluded types, false otherwise.
*/
public boolean excludesType(ResolvedType type) { public boolean excludesType(ResolvedType type) {
if (mode == MODE_LTW) { if (mode == MODE_LTW) {
return false; return false;

Loading…
Cancel
Save