Uploaded image for project: 'MRUnit'
  1. MRUnit
  2. MRUNIT-125

reduce duplicate code related to fluent methods with generics

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0
    • Labels:
      None

      Description

      There is a lot of duplicate code in order to provide fluent style with methods. We could reduce the duplicate code with generics by adding an unbound type parameter T to TestDriver and then all the fluent methods could go in TestDriver but return type T. The base classes, MapDriverBase etc, would just pass the T on so you would have:

      public abstract class TestDriver<K1, V1, K2, V2, T>
      public abstract class MapDriverBase<K1, V1, K2, V2, T> extends TestDriver<K1, V1, K2, V2, T>
      public class MapDriver<K1, V1, K2, V2> extends MapDriverBase<K1, V1, K2, V2, MapDriver<K1, V1, K2, V2>>

        Attachments

        1. mrunit-125-2.diff
          32 kB
          Bertrand Dechoux
        2. mrunit-125.diff
          47 kB
          Bertrand Dechoux
        3. mrunit-125-patch.diff
          59 kB
          Bertrand Dechoux
        4. mrunit-125-spoiler.diff
          59 kB
          Bertrand Dechoux

          Activity

            People

            • Assignee:
              bdechoux Bertrand Dechoux
              Reporter:
              jdonofrio Jim Donofrio
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: