Uploaded image for project: 'Metadata Aggregator'
  1. Metadata Aggregator
  2. MDA-113

improve use of generic types internally and in API

    XMLWordPrintable

    Details

      Description

      I noticed warnings like this in the Jenkins runs for the MDA:

      [WARNING] /home/jenkins/.jenkins/jobs/java-metadata-aggregator/workspace/aggregator-cli/src/main/java/net/shibboleth/metadata/cli/SimpleCommandLine.java: /home/jenkins/.jenkins/jobs/java-metadata-aggregator/workspace/aggregator-cli/src/main/java/net/shibboleth/metadata/cli/SimpleCommandLine.java uses unchecked or unsafe operations.
      [WARNING] /home/jenkins/.jenkins/jobs/java-metadata-aggregator/workspace/aggregator-cli/src/main/java/net/shibboleth/metadata/cli/SimpleCommandLine.java: Recompile with -Xlint:unchecked for details.
      

      The MDA codebase makes heavy use of generics, and applying -Xlint:unchecked indicates that it has many cases in which we're not passing the more extensive tests. We should take a solid look at this prior to final release.

      I spent an hour or so trying to work through some of the cases I found, and was able to find some patterns in what we're not doing right. The easiest ones to understand seem to be the use of raw types like Future, and things that should be polymorphic just using wildcards in multiple places with no attempt to link them together (e.g., across parameters or between parameters and results).

      In the end, though, this is happening because we didn't have a good enough understanding of the rather bonkers Java type system, and rather rather than picking at individual cases I think it needs to be done from first principles. I've therefore discarded the initial attempt.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ian@iay.org.uk Ian Young
              Reporter:
              ian@iay.org.uk Ian Young
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 days Original Estimate - 2 days
                  2d
                  Remaining:
                  Time Spent - 5 hours, 3 minutes Remaining Estimate - 1 day, 4 hours, 25 minutes
                  1d 4h 25m
                  Logged:
                  Time Spent - 5 hours, 3 minutes Remaining Estimate - 1 day, 4 hours, 25 minutes
                  5h 3m