Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4409

Convention annotation won't determine type data correctly

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: POJO
    • Labels:

      Take the following Pojo:

       

      public class MetricsData {
      
          private final Map<String, ValueMetricsData> metricsMap;
      
          @BsonCreator
          public MetricsData(
                  @BsonProperty("metrics") final Map<String, ValueMetricsData> metricsMap) {
              metricsMap = metricsMap;
          }
      
          public Map<String, ValueMetricsData> getMetricsMap() {
              return metricsMap;
          }
      }
       

      It returns the following PropertyModels:

      [PropertyModel{propertyName='metricsMap', readName='metricsMap', writeName='metricsMap', typeData=TypeData{type=Map, typeParameters=[String, ValueMetricsData]}},
       PropertyModel{propertyName='metrics', readName='null', writeName='metrics', typeData=TypeData{type=Map}}]
      

      The "metrics" property has invalid typeData.

            Assignee:
            Unassigned Unassigned
            Reporter:
            ross@mongodb.com Ross Lawley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: