DDS-Java 1.1 RTF Avatar
  1. OMG Issue

DDSJAVA11 — Operations with Collection as parameter should provide a "varargs" alternative

  • Key: DDSJAVA11-5
  • Legacy Issue Number: 18423
  • Status: open  
  • Source: ADLINK Advanced Technology Office ( Julien Enoch)
  • Summary:

    The use of Collection for providing a single "parameter" is rather cumbersome and could be greatly improved by providing a "varargs" alternative.

    Here is an example that showcases the issue:
    p = dp.createPublisher(
    dp.getDefaultPublisherQos().withPolicy(
    pf.Partition().withName(Arrays.asList("MyPartition"))
    ));

    In this case a withName(String... names) operation will simplify the code as shown below:
    p = dp.createPublisher(
    dp.getDefaultPublisherQos().withPolicy(
    pf.Partition().withName("MyPartition")
    ));

    Moreover the use of Collection type could lead to compilation error as in the following case:

    statusCondition.setEnabledStatuses(Arrays.toList(DataAvailableStatus.class));

  • Reported: DDS-Java 1.0 — Wed, 6 Feb 2013 05:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT