Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4834

JaninoRelMetadataProvider uses hardcoded class name

    XMLWordPrintableJSON

Details

    Description

      This seems caused by CALCITE-4546 (fbbdf46)

      JaninoRelMetadataProvider lines 135 & 141 is using (for the generated code) the hardcoded name of the class MetadataDef:

      buff.append("  private final org.apache.calcite.rel.metadata.MetadataDef def;\n");
      for (Map.Entry<MetadataHandler<?>, String> handlerAndName : handlerToName.entrySet()) {
        ...
        .append("      org.apache.calcite.rel.metadata.MetadataDef def");
      

      This can lead to issues (e.g. if a downstream project shades Calcite library). The safer way to do this is using Class#getName, as it is already done in the rest of the code, e.g. in JaninoRelMetadataProvider:158:

      .append(MetadataDef.class.getName())
      

      Attachments

        Issue Links

          Activity

            People

              rubenql Ruben Q L
              rubenql Ruben Q L
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m