Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5182

Extract private methods in ConceptServiceImpl.saveMethod

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Could
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Core 2.2.0
    • Component/s: None
    • Labels:
    • Complexity:
      Low

      Description

      To increase readability I suggest we could refactor the save method to extract methods and thus remove the comment.

      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/api/impl/ConceptServiceImpl.java#L166-L171

      voidOldConceptName(changedName)
      

      https://github.com/openmrs/openmrs-core/blob/master/api/src/main/java/org/openmrs/api/impl/ConceptServiceImpl.java#L183-L189

      createConceptNameFromMatchingClone(concept,uuidClonedConceptNameMap, nameInDB)
      

      Keep the private methods in order of their execution and right after the method saveConcept.

      And only extract the private methods without refactoring them as well in order to ease code review and reduce risk of breaking the code. If you have an idea on how to improve the private methods later on submit another PR.

        Attachments

          Activity

            People

            Assignee:
            surette33 Joshua Surette
            Reporter:
            meenakshi Meenakshi Dhanani
            Designated Committer:
            Meenakshi Dhanani
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 30 minutes Original Estimate - 30 minutes
                30m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour
                1h