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

getName(Locale locale, boolean exact) simply calls getName() if exact = false

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: OpenMRS 1.8.4, OpenMRS 1.9.1, Platform 1.10.0
    • Fix Version/s: Platform 2.0.0
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Medium

      Description

      Not quite sure what the intention is here, but if you call getName(someLocale, false), this method just delegats to getName(), which seems wrong:

      public ConceptName getName(Locale locale, boolean exact) {
      		
      		// fail early if this concept has no names defined
      		if (getNames().size() == 0) {
      			if (log.isDebugEnabled())
      				log.debug("there are no names defined for: " + conceptId);
      			return null;
      		}
      		
      		if (log.isDebugEnabled())
      			log.debug("Getting conceptName for locale: " + locale);
      		if (exact && locale != null) {
      			ConceptName preferredName = getPreferredName(locale);
      			if (preferredName != null)
      				return preferredName;
      			
      			ConceptName fullySpecifiedName = getFullySpecifiedName(locale);
      			if (fullySpecifiedName != null)
      				return fullySpecifiedName;
      			else if (getSynonyms(locale).size() > 0)
      				return getSynonyms(locale).iterator().next();
      			
      			return null;
      			
      		} else {
      			//just get any name
      			return getName();
      		}
      	}
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sandeepraparthi Sandeep Raparthi
              Reporter:
              mogoodrich Mark Goodrich
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 hours
                  2h
                  Remaining:
                  Remaining Estimate - 2 hours
                  2h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified