Community
Participate
Working Groups
Build ID: 20090621-0832 Steps To Reproduce: 1. Create a class with a long annotation and format it manually: @MessageDriven(mappedName = "filiality/SchedulerMQService", activationConfig = { @ActivationConfigProperty(propertyName = "cronTrigger", propertyValue = "0/10 * * * * ?") }) @RunAs("admin") @ResourceAdapter("quartz-ra.rar") @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public class EventProcessingScheduledBean implements Job { } 2. CTRL + SHIFT + F 3. Result: @MessageDriven(mappedName = "filiality/SchedulerMQService", activationConfig = { @ActivationConfigProperty(propertyName = "cronTrigger", propertyValue = "0/10 * * * * ?") }) @RunAs("admin") @ResourceAdapter("quartz-ra.rar") @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public class EventProcessingScheduledBean implements Job { } More information: It is expected that Eclipse formatter will NOT join the lines within annotations when "never join lines" option is set for both code and comments.
I believe this is due to the fact that there is no "alignment" for annotations.
Created attachment 142504 [details] Draft patch First attempt to fix the problem. The proposed approach is minimalist (i.e. does not add any new preferences). It just creates a new alignment using the expressions in initializers preference value. Using this patch the snippet would be formatted as follow: @MessageDriven(mappedName = "filiality/SchedulerMQService", activationConfig = { @ActivationConfigProperty(propertyName = "cronTrigger", propertyValue = "0/10 * * * * ?") }) @RunAs("admin") @ResourceAdapter("quartz-ra.rar") @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public class EventProcessingScheduledBean { } The question is: is this an acceptable behavior or do we think about adding new specific alignments for the annotations? Olivier, what's your mind about this?
Comment on attachment 142504 [details] Draft patch The patch of bug 282030 will solve this issue...
Fixed by bug 282030 patch released for 3.6M6...
Verified for 3.6M6 using build I20100305-1011