Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-20

Generated code throws compiler errors

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: Mac OS
      Platform: PC

    Description

      Seeing a problem with generated code in the affinity yang file.

      The compiler errors is:

      [ERROR] /Users/sraman/affinity/affinity/yang/target/generated-sources/sal/org/opendaylight/yang/gen/v1/urn/opendaylight/affinity/rev130916/CreateAffinityGroupInputBuilder.java:[54,19] error: CreateAffinityGroupInputImpl is not abstract and does not override abstract method getAffinityIdentifier() in AffinityGroup
      [ERROR] /Users/sraman/affinity/affinity/yang/target/generated-sources/sal/org/opendaylight/yang/gen/v1/urn/opendaylight/affinity/rev130916/CreateAffinityGroupInputBuilder.java:[66,8] error: method does not override or implement a method from a supertype

      (1) The first error may be due to incorrect order of following blocks of code.

      (2) There seems to be an issue with the @Override directive at line 66. This is the getAffinityIdentifers() method.

      Affinity-topology-all.yang is checked into the affinity repo.

      ====
      public CreateAffinityGroupInput build()

      { return new CreateAffinityGroupInputImpl(this); }

      private static class CreateAffinityGroupInputImpl implements CreateAffinityGroupInput {

      private final List<AffinityIdentifiers> _affinityIdentifiers;
      private final String _id;
      private Map<Class<? extends Augmentation<CreateAffinityGroupInput>>, Augmentation<CreateAffinityGroupInput>> augmentation = new HashMap<>();

      private CreateAffinityGroupInputImpl(CreateAffinityGroupInputBuilder builder)

      { this._affinityIdentifiers = builder.getAffinityIdentifiers(); this._id = builder.getId(); this.augmentation.putAll(builder.augmentation); }

      @Override
      public List<AffinityIdentifiers> getAffinityIdentifiers()

      { return _affinityIdentifiers; }

      @Override
      public String getId()

      { return _id; }

      @SuppressWarnings("unchecked")
      @Override
      public <E extends Augmentation<CreateAffinityGroupInput>> E getAugmentation(Class<E> augmentationType) {
      if (augmentationType == null)

      { throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!"); }

      return (E) augmentation.get(augmentationType);
      }

      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            suchi.raman@plexxi.com Suchitra Raman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: