[forge-dev] Issue with @FacetConstraint

Ivan St. Ivanov ivan.st.ivanov at gmail.com
Thu Feb 27 16:24:21 EST 2014


Hi folks,

I am testing my Forge 2.0 addon for SAP HANA Cloud. One of my commands (the
setup command) installs the special facet that I have developer
(SapHanaCloudFacet). Another command is annotated
with @FacetConstraint(SapHanaCloudFacet.class). Even after I do setup, the
other command is not enabled.

I started the debugger. The isInstalled method of my facet returned true.
So I went on to see what happens with the isEnabled() method. I dug as deep
as the AbstractFaceted::safeGetFacet(Class<F> type) method. What it does
is: it searches all the installed facets and it checks whether the expected
one is among them by calling type.isInstance(facet).

The problem in my case is that all the facet objects are actually proxies.
So I expect the type to be com.sap.cloud.forge.SapHanaCloudFacet, but it is
actually something
like org.jboss.forge.addon.facets.AbstractFacet_$$_javassist_904cc85e-43dd-404a-846c-ed4709d14dea.
Eventually, the isInstance method returns false.

Am I doing something wrong? The code of the addon can be found here:
https://github.com/ivannov/addon-saphcp.

Thanks,
Ivan

P.S. Did you, guys, bring anything new to the Windows shell? I am still
using my Linux VM for Forge development.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/forge-dev/attachments/20140227/9aeb4ec1/attachment.html 


More information about the forge-dev mailing list