gt: 		if (tags == null) {
context: /**
   * This Source Code Form is subject to the terms of the Mozilla Public License,
   * v. 2.0. If a copy of the MPL was not distributed with this file, You can
   * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
   * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
   *
   * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
   * graphic logo is a trademark of OpenMRS Inc.
   */
  package org.openmrs;
  
  import java.util.Collection;
  import java.util.Date;
  import java.util.HashSet;
  import java.util.Locale;
  
  import org.apache.commons.lang.StringUtils;
  import org.apache.lucene.analysis.core.LowerCaseFilterFactory;
  import org.apache.lucene.analysis.standard.StandardFilterFactory;
  import org.apache.lucene.analysis.standard.StandardTokenizerFactory;
  import org.hibernate.search.annotations.Analyze;
  import org.hibernate.search.annotations.Analyzer;
  import org.hibernate.search.annotations.AnalyzerDef;
  import org.hibernate.search.annotations.DocumentId;
  import org.hibernate.search.annotations.Field;
  import org.hibernate.search.annotations.FieldBridge;
  import org.hibernate.search.annotations.Indexed;
  import org.hibernate.search.annotations.IndexedEmbedded;
  import org.hibernate.search.annotations.TokenFilterDef;
  import org.hibernate.search.annotations.TokenizerDef;
  import org.openmrs.api.ConceptNameType;
  import org.openmrs.api.db.hibernate.search.bridge.LocaleFieldBridge;
  import org.openmrs.util.OpenmrsUtil;
  
  /**
   * ConceptName is the real world term used to express a Concept within the idiom of a particular
   * locale.
   */
  @Indexed
  @AnalyzerDef(name = "ConceptNameAnalyzer", tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class), filters = {
          @TokenFilterDef(factory = StandardFilterFactory.class), @TokenFilterDef(factory = LowerCaseFilterFactory.class) })
  @Analyzer(definition = "ConceptNameAnalyzer")
  public class ConceptName extends BaseOpenmrsObject implements Auditable, Voidable, java.io.Serializable {
  	
  	public static final long serialVersionUID = 2L;
  	
  	@DocumentId
  	private Integer conceptNameId;
  	
  	@IndexedEmbedded(includeEmbeddedObjectId = true)
  	private Concept concept;
  	
  	@Field
  	private String name;
  	
  	@Field(analyze = Analyze.NO)
  	@FieldBridge(impl = LocaleFieldBridge.class)
  	private Locale locale; // ABK: upgraded from a plain string to a full locale object
  	
  	private User creator;
  	
  	private Date dateCreated;
  	
  	@Field
  	private Boolean voided = false;
  	
  	private User voidedBy;
  	
  	private Date dateVoided;
  	
  	private String voidReason;
  	
  	private Collection<ConceptNameTag> tags;
  	
  	@Field
  	private ConceptNameType conceptNameType;
  	
  	@Field
  	private Boolean localePreferred = false;
  	
  	// Constructors
  	
  	/** default constructor */
  	public ConceptName() {
  	}
  	
  	/**
  	 * Convenience constructor to create a ConceptName object by primary key
  	 *
  	 * @param conceptNameId
  	 */
  	public ConceptName(Integer conceptNameId) {
  		this.conceptNameId = conceptNameId;
  	}
  	
  	public ConceptName(String name, Locale locale) {
  		setName(name);
  		setLocale(locale);
  	}
  	
  	/**
  	 * @return Returns the conceptId.
  	 */
  	public Integer getConceptNameId() {
  		return conceptNameId;
  	}
  	
  	/**
  	 * @param conceptNameId The conceptId to set.
  	 */
  	public void setConceptNameId(Integer conceptNameId) {
  		this.conceptNameId = conceptNameId;
  	}
  	
  	public Concept getConcept() {
  		return concept;
  	}
  	
  	public void setConcept(Concept concept) {
  		this.concept = concept;
  	}
  	
  	public String getName() {
  		return name;
  	}
  	
  	public void setName(String name) {
  		if (name != null && StringUtils.isBlank(name) && StringUtils.isNotBlank(this.name)
  		        && this.getConceptNameType().equals(ConceptNameType.SHORT)) {
  			this.setVoided(true);
  		} else {
  			this.name = name;
  		}
  	}
  	
  	public Locale getLocale() {
  		return locale;
  	}
  	
  	public void setLocale(Locale locale) {
  		this.locale = locale;
  	}
  
  	/**
  	 * @return Returns the creator.
  	 */
  	public User getCreator() {
  		return creator;
  	}
  	
  	/**
  	 * @param creator The creator to set.
  	 */
  	public void setCreator(User creator) {
  		this.creator = creator;
  	}
  	
  	/**
  	 * @return Returns the dateCreated.
  	 */
  	public Date getDateCreated() {
  		return dateCreated;
  	}
  	
  	/**
  	 * @param dateCreated The dateCreated to set.
  	 */
  	public void setDateCreated(Date dateCreated) {
  		this.dateCreated = dateCreated;
  	}
  	
  	/**
  	 * Returns whether the ConceptName has been voided.
  	 *
  	 * @return true if the ConceptName has been voided, false otherwise.
  	 */
  	public Boolean isVoided() {
  		return voided;
  	}
  	
  	/**
  	 * Returns whether the ConceptName has been voided.
  	 *
  	 * @return true if the ConceptName has been voided, false otherwise.
  	 */
  	public Boolean getVoided() {
  		return isVoided();
  	}
  	
  	/**
  	 * Sets the voided status of this ConceptName.
  	 *
  	 * @param voided the voided status to set.
  	 */
  	public void setVoided(Boolean voided) {
  		this.voided = voided;
  	}
  	
  	/**
  	 * Returns the User who voided this ConceptName.
  	 *
  	 * @return the User who voided this ConceptName, or null if not set
  	 */
  	public User getVoidedBy() {
  		return voidedBy;
  	}
  	
  	/**
  	 * Sets the User who voided this ConceptName.
  	 *
  	 * @param voidedBy the user who voided this ConceptName.
  	 */
  	public void setVoidedBy(User voidedBy) {
  		this.voidedBy = voidedBy;
  	}
  	
  	/**
  	 * Returns the Date this ConceptName was voided.
  	 *
  	 * @return the Date this ConceptName was voided.
  	 */
  	public Date getDateVoided() {
  		return dateVoided;
  	}
  	
  	/**
  	 * Sets the Data this ConceptName was voided.
  	 *
  	 * @param dateVoided the date the ConceptName was voided.
  	 */
  	public void setDateVoided(Date dateVoided) {
  		this.dateVoided = dateVoided;
  	}
  	
  	/**
  	 * Returns the reason this ConceptName was voided.
  	 *
  	 * @return the reason this ConceptName was voided
  	 */
  	public String getVoidReason() {
  		return voidReason;
  	}
  	
  	/**
  	 * Sets the reason this ConceptName was voided.
  	 *
  	 * @param voidReason the reason this ConceptName was voided
  	 */
  	public void setVoidReason(String voidReason) {
  		this.voidReason = voidReason;
  	}
  	
  	/**
  	 * Returns the tags which have been attached to this ConceptName.
  	 *
  	 * @return the tags.
  	 */
  	public Collection<ConceptNameTag> getTags() {
  		return tags;
  	}
  	
  	/**
  	 * Set the tags which are attached to this ConceptName.
  	 *
  	 * @see Concept#setPreferredName(ConceptName)
  	 * @see Concept#setFullySpecifiedName(ConceptName)
  	 * @see Concept#setShortName(ConceptName)
  	 * @param tags the tags to set.
  	 */
  	public void setTags(Collection<ConceptNameTag> tags) {
  		this.tags = tags;
  	}
  	
  	/**
  	 * @return the conceptNameType
  	 */
  	public ConceptNameType getConceptNameType() {
  		return this.conceptNameType;
  	}
  	
  	/**
  	 * @param conceptNameType the conceptNameType to set
  	 */
  	public void setConceptNameType(ConceptNameType conceptNameType) {
  		this.conceptNameType = conceptNameType;
  	}
  	
  	/**
  	 * Getter for localePreferred
  	 *
  	 * @return localPreferred
  	 */
  	public Boolean isLocalePreferred() {
  		return localePreferred;
  	}
  	
  	/**
  	 * Getter to be used by spring, developers should use {@link #isLocalePreferred()}
  	 *
  	 * @return true if it is the localePreferred name otherwise false
  	 */
  	public Boolean getLocalePreferred() {
  		return localePreferred;
  	}
  	
  	/**
  	 * @param localePreferred the localePreferred to set
  	 */
  	public void setLocalePreferred(Boolean localePreferred) {
  		this.localePreferred = localePreferred;
  	}
  	
  	/**
  	 * Adds a tag to the concept name. If the tag is new (has no existing occurrences) a new
  	 * ConceptNameTag will be created with a blank description.
  	 *
  	 * @see Concept#setPreferredName(ConceptName)
  	 * @see Concept#setFullySpecifiedName(ConceptName)
  	 * @see Concept#setShortName(ConceptName)
  	 * @param tag human-readable text string for the tag
  	 */
  	public void addTag(String tag) {
  		addTag(tag, "");
  	}
  	
  	/**
  	 * Adds a tag to the concept name. If the tag is new (has no existing occurrences) a new
  	 * ConceptNameTag will be created with the given description.
  	 *
  	 * @see Concept#setPreferredName(ConceptName)
  	 * @see Concept#setFullySpecifiedName(ConceptName)
  	 * @see Concept#setShortName(ConceptName)
  	 * @param tag human-readable text string for the tag
  	 * @param description description of the tag's purpose
  	 */
  	public void addTag(String tag, String description) {
  		ConceptNameTag nameTag = new ConceptNameTag(tag, description);
  		addTag(nameTag);
  	}
  	
  	/**
  	 * Attaches a tag to the concept name.
  	 *
  	 * @see Concept#setPreferredName(ConceptName)
  	 * @see Concept#setFullySpecifiedName(ConceptName)
  	 * @see Concept#setShortName(ConceptName)
  	 * @param tag the tag to add
  	 */
  	public void addTag(ConceptNameTag tag) {
  