[macker-user] <Allow> tag doesn't consider my patterns?
Brought to you by:
barredijkstra,
melquiades
|
From: copernic J. <cop...@gm...> - 2007-09-25 15:23:22
|
Hi all,
I am facing a strange behaviour with Macker.
I have a project containing three PrintHelloWorld classes:
- PrintHelloWorld1
- PrintHelloWorld2
- PrintHelloWorld3
My macker.xml rules file contain a pattern that only includes my
PrintHelloWorld3 class. And I only have one access-rule that state that the
classes contained by my pattern "patternWorld3" has to only access the
"java.**" classes.
So my macker.xml file looks like that:
<macker>
<ruleset name="Simple example">
<pattern name="patternWorld3">
<include class="PrintHelloWorld"/>
</pattern>
<access-rule>
<allow>
<from pattern="patternWorld3" />
<to class="java.**" />
</allow>
</access-rule>
</ruleset>
</macker>
The problem is that when I check the rules with the command ant macker ,
Macker tells me that the other classes (PrintHelloWorld1 and
PrintHelloWorld2) , that aren't supposed to be included in the pattern
"patternWorld3", are also violating my access-rule.
This is the trace I get:
macker:
[macker]
[macker] (Checking ruleset: Simple example ...)
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld
[macker] to void
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld2
[macker] to java.io.PrintStream
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld2
[macker] to java.lang.Object
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld2
[macker] to java.lang.String
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld2
[macker] to java.lang.System
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld2
[macker] to void
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld3
[macker] to java.io.PrintStream
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld3
[macker] to java.lang.Object
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld3
[macker] to java.lang.String
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld3
[macker] to java.lang.System
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld3
[macker] to void
[macker]
[macker] (11 errors)
[macker]
[macker] Macker rules checking failed
BUILD FAILED
This is strange because I thought that normally I only should get errors
from PrintHelloWorld3, defined my the pattern.
The <allow> rule tag doesn't seems to take into consideration my pattern and
in fact apply the rule checking on all of the primary classes
(PrintHelloWorld1, PrintHelloWorld2 and PrintHelloWorld3). The only way to
currently bypass that issue is to use a subset on the patternWorld3 so by
adding this line to the macker.xml file:
<subset pattern="patternWorld3"/>
then I get the what I was looking for:
macker:
[macker]
[macker] (Checking ruleset: Simple example ...)
[macker]
[macker] Illegal reference
[macker] from PrintHelloWorld
[macker] to void
[macker]
[macker] (1 error)
[macker]
[macker] Macker rules checking failed
BUILD FAILED
Why is my patternWorld3 isn't consider without a subset tag in my allow
statement?
Have I understood wrongly the semantic of the <allow> tag, or the pattern?
thanks in advance,
Cheers,
Jeremy
|