Closed GoogleCodeExporter closed 9 years ago
This is probably the same bug described in Issue 12.
Original comment by goo...@vocaro.com
on 18 Dec 2008 at 8:03
Another problem with ExpressionUtils is that if you have properties like this:
a.b = foo
a.b.c = bar
Then the tree that is created will look like this:
{a={b=foo}}
No exception is thrown, but the "a.b.c" property is not there!
Original comment by goo...@vocaro.com
on 18 Dec 2008 at 8:34
I spent a lot of time trying to fix this bug, and I finally realized that it's
unfixable. Let me illustrate with an
example.
Consider this property and its corresponding expression tree:
a.b = "foo" --> {a = {b = "foo"} }
And this one:
a.c = "bar" --> {a = {c = "bar"} }
Now, if both of these properties are defined, the two trees will merge into one:
{a = {b = "foo", c = "bar"} }
That's all well and good.
But now consider this property and its corresponding tree:
a.b.c = "baz" --> {a = {b = {c = "baz"} } }
How would you merge this into the previous tree? You can't! That's because both
trees have different values
for "b". The former defines it as the string "bar" while the latter defines it
as the map {c="baz"}. It can't be
both.
So the problem here is that the expression tree data structure, as defined by
ExpressionUtils, is invalid. It
requires a single key to map to more than one value, but of course this is
impossible. Fixing the problem will
require changing the very definition of the expression tree data structure.
Original comment by goo...@vocaro.com
on 18 Dec 2008 at 9:10
Hi,
Thank you for all this debug!
I will try to have a look where we use this ExpressionUtil class and maybe we
can use
something else to avoid this problem.
Regards,
Cédric,
Original comment by MimilO...@gmail.com
on 13 Jan 2009 at 10:45
Hello,
I removed the use of the ExpressionUtil.createTree() and fall back on the
properties.get(key) and it sounds to work as expected on my tests:
Test:
<properties>
<a.b.c>JavaHelp example</a.b.c>
<a.b.c.d>article.xml</a.b.c.d>
</properties>
<echo message="postprocess ${a.b.c} ${basedir}" />
<echo>${a.b.c.d}</echo>
Result:
[echo] postprocess JavaHelp example C:\projets\docbkx\docbkx-samples
[echo] article.xml
Wilfred, any objection to remove the use of ExpressionUtil on this part of
AbstractTransformerMojo?
Cedric,
}
Original comment by MimilO...@gmail.com
on 5 Mar 2009 at 10:20
remove of ExpressionUtils use
Original comment by MimilO...@gmail.com
on 18 Mar 2009 at 9:23
Original comment by MimilO...@gmail.com
on 18 Mar 2009 at 9:30
Issue 12 has been merged into this issue.
Original comment by MimilO...@gmail.com
on 18 Mar 2009 at 9:33
Original issue reported on code.google.com by
goo...@vocaro.com
on 18 Dec 2008 at 7:47