<commit_before>package gov.nih.nci.ncicb.cadsr.loader.validator;
import gov.nih.nci.ncicb.cadsr.domain.*;
import gov.nih.nci.ncicb.cadsr.loader.ElementsLists;
import gov.nih.nci.ncicb.cadsr.loader.event.ProgressListener;
import java.util.*;
import gov.nih.nci.ncicb.cadsr.loader.util.*;

public class DescriptionValidator implements Validator
{
  private ElementsLists elements = ElementsLists.getInstance();
  
  private ValidationItems items = ValidationItems.getInstance();
  
  public DescriptionValidator()
  {
  }
  
  public void addProgressListener(ProgressListener l) {

  }
  
  public ValidationItems validate() 
  {
    List<ObjectClass> ocs = (List<ObjectClass>)elements.getElements(DomainObjectFactory.newObjectClass().getClass());
    if(ocs != null) {   
      for(ObjectClass oc : ocs) {  
        if(StringUtil.isEmpty(oc.getPreferredDefinition()))
          items.addItem(new ValidationWarning
                        (PropertyAccessor.getProperty
                         ("class.no.description", oc.getLongName()), oc));
      }
    }
    boolean found = false;
    List<DataElement> des = (List<DataElement>)elements.getElements(DomainObjectFactory.newDataElement().getClass());
    if(des != null) {  
      for(DataElement de : des) {  
        for(AlternateName an : de.getAlternateNames()) {
          if(an.getType() == AlternateName.TYPE_UML_DE) 
            found = true;
            break;
        }
      if(!found)
        items.addItem(new ValidationWarning
                      (PropertyAccessor.getProperty
                       ("attribute.no.description",
                        de.getDataElementConcept().getLongName()), de));
      }
    }
    
    return items; 
    }
}<commit_msg>*** empty log message ***<commit_after>package gov.nih.nci.ncicb.cadsr.loader.validator;
import gov.nih.nci.ncicb.cadsr.domain.*;
import gov.nih.nci.ncicb.cadsr.loader.ElementsLists;
import gov.nih.nci.ncicb.cadsr.loader.event.ProgressListener;
import java.util.*;
import gov.nih.nci.ncicb.cadsr.loader.util.*;

public class DescriptionValidator implements Validator
{
  private ElementsLists elements = ElementsLists.getInstance();
  
  private ValidationItems items = ValidationItems.getInstance();
  
  public DescriptionValidator()
  {
  }
  
  public void addProgressListener(ProgressListener l) {

  }
  
  public ValidationItems validate() 
  {
    List<ObjectClass> ocs = (List<ObjectClass>)elements.getElements(DomainObjectFactory.newObjectClass().getClass());
    if(ocs != null) {   
      for(ObjectClass oc : ocs) {  
        if(StringUtil.isEmpty(oc.getPreferredDefinition()))
          items.addItem(new ValidationWarning
                        (PropertyAccessor.getProperty
                         ("class.no.description", oc.getLongName()), oc));
      }
    }
    boolean found = false;
    List<DataElement> des = (List<DataElement>)elements.getElements(DomainObjectFactory.newDataElement().getClass());
    if(des != null) {  
      for(DataElement de : des) {  
        if(de.getDefinitions() == null || de.getDefinitions().size() == 0)
          items.addItem(new ValidationWarning
                        (PropertyAccessor.getProperty
                         ("attribute.no.description",
                          de.getDataElementConcept().getLongName()), de));
      }
    }
    
    return items; 
    }
}
{'fraction_non_alphanumeric': 0.11818993748139327, 'fraction_numerical': 0.00029770765108663293, 'mean_word_length': 2.7209302325581395, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5528724', 'n_tokens_mistral': 995, 'n_tokens_neox': 963, 'n_words': 153}