-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotation String parameter value not transformed #43
Comments
This needs a different type of transformation on String constants in the class file. The class file transformation will transform class name reference which are known to be be class name references (e.g. Class constants). But String constants can be anything and unrelated to class names. So we may need some additional transformation rules which can indicate which String constants also need transformation. This is unfortunately very hard since strings can be anything while class names can only be class names. I have encountered String constants which are regex expressions for javax things that would also need transformation. (sigh) |
Also, is this not the same issue as #44? That is, the need to transform selected String constants in the class file's constant pool. |
@bjhargrave , yes, the String transformation is very tricky and direct mapping seems not enough. For example we have some cases where sub part of the string needs transformation. For example in the jsp compiler all javax.servlet String should be replaced. This is perhaps a pathological case for which the EE9 compiler should be used instead of the EE8 one being transformed. The direct mapping global to all classes is interesting when we don't know the class names ahead of time (for example when transforming a user application). This is the case of this reported issue. The annotated class is a user class. BTW, the reported problem with Annotations parameter values containing String is that they don't benefit from ConstantPool UTF8 direct transformation, The String "javax.jms.Queue" is transformed in the constant Pool to "jakarta.jms.Queue" but the Annotation Parameter value still references "javax.jms.Queue" that is still present in the ConstantPool. |
@bjhargrave @tbitonti I am wandering if String constant (ConstantPool.CONSTANT_String, ConstantValueAttribute.NAME) should be attempted to be transformed as Descriptor (like in https://github.com/eclipse/transformer/blob/master/org.eclipse.transformer/src/main/java/org/eclipse/transformer/action/impl/ClassActionImpl.java#L815 or https://github.com/eclipse/transformer/blob/master/org.eclipse.transformer/src/main/java/org/eclipse/transformer/action/impl/ClassActionImpl.java#L1138) |
Signed-off-by: JF Denise <jdenise@redhat.com>
Signed-off-by: JF Denise <jdenise@redhat.com>
For example:
@MessageDriven(name = "TestEnvEntryMD", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "java:jboss/queue/testEnvEntry") })
public class TestEnvEntryMDBean implements MessageListener {
}
"javax.jms.Queue" is of type String and https://github.com/eclipse/transformer/blob/master/org.eclipse.transformer/src/main/java/org/eclipse/transformer/action/impl/ClassActionImpl.java#L983
doesn't handle String type. Direct String replacement should occur.
The text was updated successfully, but these errors were encountered: