Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-9255

Duplicate java elements in CDI validation problem message

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.3.0.M3
    • 3.3.0.M3
    • cdi
    • None

      EXECUTE: Create any CDI project with Seam Solder module.
      EXECUTE: Create a few types:

      @Retention(RUNTIME)
      @GenericType(MessageSystemConfiguration.class)
      @interface ACMEQueue {
          String name();
      }
      
      public class MyMessageQueues {
      	@Produces
      	@ACMEQueue("defaultQueue")
      	@Named("aaa")
      	MessageSystemConfiguration defaultQueue = new MessageSystemConfiguration(null);
      
      	@Produces
      	@Durable
      	@ACMEQueue("defaultQueue")
      	@Named("aaa")
      	MessageSystemConfiguration defaultQueue1 = new MessageSystemConfiguration(null);
      }
      
      @GenericConfiguration(ACMEQueue.class)
      class MessageManager {
      
      	@Inject
      	@Generic
      	MessageQueue queue;
      
      	@Produces
      	@ApplyScope
      	MessageDispatcher messageDispatcherProducer() {
      		return queue.createMessageDispatcher();
      	}
      
      	@Produces
      	DispatcherPolicy getPolicy() {
      		return queue.getDispatcherPolicy();
      	}
      }
      
      @GenericConfiguration(ACMEQueue.class)
      @ApplyScope
      public class QueueManager implements Serializable {
      
      	@Produces
      	@ApplyScope
      	public MessageQueue messageQueueProducer() {
      //		return factory.createMessageQueue(config.name());
      		return null;
      	}
      }
      
      public interface MessageQueue {}
      

      EXECUTE: Save the files.
      ASSERT: Both @Named("aaa") marked as duplicate EL names: "A few beans (QueueManager.messageQueueProducer(), MyMessageQueues.defaultQueue1, MyMessageQueues.defaultQueue) have the same EL name and the name is not resolvable [JSR-299 §5.3.1]
      FAILURE: Both @Named("aaa") marked as duplicate EL names: "A few beans (QueueManager.messageQueueProducer(), MyMessageQueues.defaultQueue1, MyMessageQueues.defaultQueue, QueueManager.messageQueueProducer()) have the same EL name and the name is not resolvable [JSR-299 §5.3.1] <-- QueueManager.messageQueueProducer() mentioned twice!

            alexeykazakov Alexey Kazakov
            alexeykazakov Alexey Kazakov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: