Uploaded image for project: 'CarbonData'
  1. CarbonData
  2. CARBONDATA-155

Code refactor to avoid the Type Casting in compareTo method

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      PraveenAdlakha added a note 23 hours ago
      Hi ,

      Would like to suggest a couple of things here remove Comparable from the class definition as Distributable is already implementing it.

      Let use generics so that we donot have to typeCast everywhere in the compare method for that need to do two things:
      1) Change the class definition of Distributable to :

      public abstract class Distributable> implements Comparable

      2) Change the compareTo method definition to:

      public int compareTo(TableBlockInfo other)

      Let me know incase you are facing any isssue in doing this I will provide the patch if needed.

      Attachments

        Activity

          People

            mohdshahidkhan Mohammad Shahid Khan
            mohdshahidkhan Mohammad Shahid Khan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

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