Discussion:
[XOM-interest] Missing EnclosingMethod attribute
Olivier Lefevre
2012-01-06 11:21:18 UTC
Permalink
Today for the first time I tried to use XOM in Android and was greeted with this error message on the console:

Dx warning: Ignoring InnerClasses attribute for an anonymous inner class
(nu.xom.Element$1) that doesn't come with an associated EnclosingMethod
attribute. This class was probably produced by a compiler that did not
target the modern .class file format. The recommended solution is to
recompile the class from source, using an up-to-date compiler and without
specifying any "-target" type options. The consequence of ignoring this
warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.

Also affected is an anonymous inner class of nu.xom.Verifier. Do you know what they are talking about and should I really recompile?

Regards,

-- O.L.
Elliotte Rusty Harold
2012-01-06 11:37:23 UTC
Permalink
First I've heard of this, but it sounds plausible. I'll have to look into it.

XOM actually goes to great lengths to avoid reflection internally, so
as long as you don't use reflection on XOM's private parts, you'll
probably be OK.

In the meantime if the warning bothers you, try changing target="1.2"
to target="1.5" in the BUILD file and recompiling from source.

As far as I can tell with a quick Google search this is only a problem
in Eclipse.

Longterm I'll need to think about what to do about this. I may have to
make two binaries. At this point I'd be willing to make the default
1.4 but not 1.5.
--
Elliotte Rusty Harold
elharo at ibiblio.org
Olivier Lefevre
2012-01-07 19:32:40 UTC
Permalink
Post by Elliotte Rusty Harold
XOM actually goes to great lengths to avoid reflection internally, so
as long as you don't use reflection on XOM's private parts, you'll
probably be OK.
OK.
Post by Elliotte Rusty Harold
As far as I can tell with a quick Google search this is only a problem
in Eclipse.
The warning comes from the ADT, which is the Eclipse Android development
plugin maintained by Google. It's unclear to me whether the warning has
general applicability or is specific to the Dalvik VM (or even to the tool
that munges *.class files into *.dex files).

-- O.L.
Olivier Lefevre
2012-01-07 19:44:16 UTC
Permalink
Post by Olivier Lefevre
Post by Elliotte Rusty Harold
As far as I can tell with a quick Google search this is only a problem
in Eclipse.
The warning comes from the ADT, which is the Eclipse Android development
plugin maintained by Google. It's unclear to me whether the warning has
general applicability or is specific to the Dalvik VM (or even to the tool
that munges *.class files into *.dex files).
I mean, regular JVMs are back-compatible and can obviously run XOM just fine
even though it is compiled for an ancient Java release but perhaps the ADT
offers a warning because it would be a real issue for Dalvik? I'll try and
report any problems.

-- O.L.

Loading...