Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-790

Static code analysis reveals not fully covered enum in ch.qos.logback.core.joran.util.PropertySetter

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.0.9
    • None
    • None

    Description

      In ch.qos.logback.core.joran.util.PropertySetter

      public AggregationType computeAggregationType(String name) {
      String cName = capitalizeFirstLetter(name);

      Method addMethod = findAdderMethod(cName);

      // if the
      if (addMethod != null) {
      AggregationType type = computeRawAggregationType(addMethod);
      switch (type)

      { case NOT_FOUND: return AggregationType.NOT_FOUND; case AS_BASIC_PROPERTY: return AggregationType.AS_BASIC_PROPERTY_COLLECTION; case AS_COMPLEX_PROPERTY: return AggregationType.AS_COMPLEX_PROPERTY_COLLECTION; }

      }

      Method setterMethod = findSetterMethod(name);
      if (setterMethod != null)

      { return computeRawAggregationType(setterMethod); }

      else

      { // we have failed return AggregationType.NOT_FOUND; }

      }

      The Aggregation types

      AS_BASIC_PROPERTY_COLLECTION, // a collection of basic attributes
      AS_COMPLEX_PROPERTY_COLLECTION; // a collection of complex attributes

      are not covered.

      If they cannot occur, suggesting

      case AS_BASIC_PROPERTY_COLLECTION:
      throw new Error("Cannot happen");
      case AS_COMPLEX_PROPERTY_COLLECTION:
      throw new Error("Cannot happen");

      to placate fussy compilers.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            dtonhofer David Tonhofer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: