Validates an entry and all its elements (sequence, features etc.).

@param entry an entry to be checked
@return a validation result
"throws ValidationEngineException
962184
public ValidationPlanResult validateAll(final Entry entry)
			throws ValidationEngineException {
		final ValidationPlanResult result = new ValidationPlanResult();
		if (entry == null) {
			return result;
		}

		//validate entry
		result.append(validate(entry));

		//validate sequence
		result.append(validate(entry.getSequence()));

		return result;
	}
1330183
public ValidationResult check(Entry entry) {
        result = new ValidationResult();

        if (entry == null) {
            return result;
        }

        //collect all gene features
        Collection<Feature> gapFeatures =
                SequenceEntryUtils.getFeatures(Feature.GAP_FEATURE_NAME, entry);
      
        gapFeatures.addAll(SequenceEntryUtils.getFeatures(Feature.ASSEMBLY_GAP_FEATURE_NAME, entry));
     	
		if (gapFeatures.isEmpty())
		{
			return result;
		}

        if (entry.getSequence() == null || entry.getSequence().getSequenceByte() == null) {
            return result;
        }

        for (Feature gapFeature : gapFeatures) {

            CompoundLocation<Location> compoundLocation = gapFeature.getLocations();
            if (compoundLocation == null || compoundLocation.getLocations() == null || compoundLocation.getLocations().size() != 1) {
                //if there is more than 1 location, just bail, there are other checks to complain if the location is
                //not a single location
                return result;
            }

            Location location = compoundLocation.getLocations().get(0);
            Long start = location.getBeginPosition();
            Long end = location.getEndPosition();
            
           
            byte[] sequenceByte=entry.getSequence().getSequenceByte();
            if(sequenceByte==null||start==null||end==null)
            	return result;
            if(start<0||end>sequenceByte.length)
            {
            	return result;
            }
           int beginPosition=start.intValue();
           int endPosition=end.intValue();
           
			for (int i=beginPosition;i<endPosition;i++)
			{
				if ('n' != (char) sequenceByte[i])
				{
					ValidationMessage<Origin> message = reportError(gapFeature.getOrigin(), MESSAGE_ID);
					String report = ValidationMessageManager.getString(FAULTY_SEQUENCE_MESSAGE, start, end);
					message.setReportMessage(report);
					return result;
				}
			}

		}

        return result;
    }
183340
@Override
    public boolean contains(final ENTRY entry) throws CouldNotPerformException {
        if (entry == null) {
            throw new NotAvailableException("entry");
        }
        return contains(entry.getId());
    }
30574
protected void storeValidation(Validation v, XMLStreamWriter writer) throws Exception
   {
      writer.writeStartElement(XML.ELEMENT_VALIDATION);

      if (v.getValidConnectionChecker() != null)
      {
         storeExtension(v.getValidConnectionChecker(), writer, XML.ELEMENT_VALID_CONNECTION_CHECKER);
      }

      if (v.getCheckValidConnectionSql() != null)
      {
         writer.writeStartElement(XML.ELEMENT_CHECK_VALID_CONNECTION_SQL);
         writer.writeCharacters(v.getValue(XML.ELEMENT_CHECK_VALID_CONNECTION_SQL, v.getCheckValidConnectionSql()));
         writer.writeEndElement();
      }

      if (v.isValidateOnMatch() != null)
      {
         writer.writeStartElement(XML.ELEMENT_VALIDATE_ON_MATCH);
         writer.writeCharacters(v.getValue(XML.ELEMENT_VALIDATE_ON_MATCH, v.isValidateOnMatch().toString()));
         writer.writeEndElement();
      }

      if (v.isBackgroundValidation() != null)
      {
         writer.writeStartElement(XML.ELEMENT_BACKGROUND_VALIDATION);
         writer.writeCharacters(v.getValue(XML.ELEMENT_BACKGROUND_VALIDATION, v.isBackgroundValidation().toString()));
         writer.writeEndElement();
      }

      if (v.getBackgroundValidationMillis() != null)
      {
         writer.writeStartElement(XML.ELEMENT_BACKGROUND_VALIDATION_MILLIS);
         writer.writeCharacters(v.getValue(XML.ELEMENT_BACKGROUND_VALIDATION_MILLIS,
                                           v.getBackgroundValidationMillis().toString()));
         writer.writeEndElement();
      }

      if (v.isUseFastFail() != null)
      {
         writer.writeStartElement(XML.ELEMENT_USE_FAST_FAIL);
         writer.writeCharacters(v.getValue(XML.ELEMENT_USE_FAST_FAIL, v.isUseFastFail().toString()));
         writer.writeEndElement();
      }

      if (v.getStaleConnectionChecker() != null)
      {
         storeExtension(v.getStaleConnectionChecker(), writer, XML.ELEMENT_STALE_CONNECTION_CHECKER);
      }

      if (v.getExceptionSorter() != null)
      {
         storeExtension(v.getExceptionSorter(), writer, XML.ELEMENT_EXCEPTION_SORTER);
      }

      writer.writeEndElement();
   }
1102477
protected String getXmlForEntry(CmsXmlSitemapUrlBean entry) {

        StringBuffer buffer = new StringBuffer();
        buffer.append("<url>");
        buffer.append(getInnerXmlForEntry(entry));
        buffer.append("</url>");
        return buffer.toString();
    }
480716
public GenericDictionaryEntry parse(String entry) {
        String[] fields = parseLine(entry);

        String surface = fields[0];
        short leftId = Short.parseShort(fields[1]);
        short rightId = Short.parseShort(fields[2]);
        short wordCost = Short.parseShort(fields[3]);

        List<String> pos = new ArrayList<>();
        pos.addAll(Arrays.asList(fields).subList(4, 10));

        List<String> features = new ArrayList<>();
        features.addAll(Arrays.asList(fields).subList(10, fields.length));

        GenericDictionaryEntry dictionaryEntry = new GenericDictionaryEntry.Builder().surface(surface).leftId(leftId)
                        .rightId(rightId).wordCost(wordCost).pos(pos).features(features).build();

        return dictionaryEntry;
    }
274601
public ValidationResult check(Entry entry) {
		result = new ValidationResult();

		if(entry == null || entry.getSequence() == null) {
			return result;
		}
		// checks the CONTIG/CO line locations cover the sequence length
		if (entry.getSequence().getContigs() != null && entry.getSequence().getContigs().size() != 0) {
			result = checkContigLocation(entry);
		}

		//collect all sources
		List<SourceFeature> sources = new ArrayList<SourceFeature>();
		for (Feature feature : entry.getFeatures()) {
			if (feature instanceof SourceFeature) {
				sources.add((SourceFeature) feature);
			}
		}

		if (sources.isEmpty()) {
			return result;
		}

		//checks sequence
		Sequence sequence = entry.getSequence();
		if (sequence == null) {
			return result;
		}
		Long sequenceSize = sequence.getLength();

		//collection sources' locations
		boolean hasTransgenic = false;
		List<Location> sourceLocations = new ArrayList<>();
		boolean isSourceFocuswithFullSequenceCoverage = false;
		Origin firstSourceOrigin = sources.get(0).getOrigin();

		for (SourceFeature source : sources) {
			List<Location> locations = source.getLocations().getLocations();

			if (!source.isTransgenic() && !source.isFocus()) {
				if (!locations.isEmpty()) {
					sourceLocations.add(locations.iterator().next());
				}
			} else {
				if (hasTransgenic || isSourceFocuswithFullSequenceCoverage) {
					reportError(source.getOrigin(), MESSAGE_ID_TRANSGENIC_FOCUS_OCCURRENCE);
				}

				if (source.isTransgenic()) {
					hasTransgenic = true;
					if(sequenceSize > source.getLength())
						reportError(source.getOrigin(), MESSAGE_ID_TRANSGENIC_SEQUENCE_COVERAGE);
				}

				if (source.isFocus() && sequenceSize == source.getLength()) {
					isSourceFocuswithFullSequenceCoverage = true;
				}
			}

		}

		if (sourceLocations.isEmpty() && !isSourceFocuswithFullSequenceCoverage) {
			reportCoverageError(result, entry.getOrigin(), MESSAGE_ID_NO_LOCATIONS, 0, sequenceSize);
			return result;
		}

		//sorts location so they will be checked in proper order
		Collections.sort(sourceLocations, (o1, o2) -> o1.getBeginPosition().compareTo(o2.getBeginPosition()));

		Iterator<Location> locationIter = sourceLocations.iterator();
		Location location = locationIter.next();
		Long[] firstLocation = checkLocation(location);

		//checks first location
		if (firstLocation[0] != 1 && !hasTransgenic) {
			result.append(EntryValidations.createMessage(firstSourceOrigin, Severity.ERROR, MESSAGE_ID_FIRST_BASE_ERROR, firstLocation[0]));
			return result;
		}

		Long[] lastLocationPositions = null;
		if (sourceLocations.size() == 1) {
			lastLocationPositions = firstLocation;
		} else {
			//check further locations
			for (; locationIter.hasNext(); ) {
				location = locationIter.next();
				lastLocationPositions = checkLocation(location);

				if ((firstLocation[1] + 1) != lastLocationPositions[0]) {//not contiguous
					if ((firstLocation[1] + 1) > lastLocationPositions[0]) {
						//there is an overlap, add error
						reportCoverageError(result, firstSourceOrigin, MESSAGE_ID_LOCATIONS_OVERLAP, 0, sequenceSize);
					} else if (!isSourceFocuswithFullSequenceCoverage && !hasTransgenic){
						reportCoverageError(result, firstSourceOrigin, MESSAGE_ID_GAPS_IN_LOCATIONS, 0, sequenceSize);
					}
					return result;
				}

				firstLocation[1] = lastLocationPositions[1];
			}

		}

		if(lastLocationPositions!= null && lastLocationPositions[0] != null && lastLocationPositions[1] != null) {
			if (lastLocationPositions[1] > sequenceSize) {//longer than
				reportCoverageError(result, firstSourceOrigin, MESSAGE_ID_LONG, firstLocation[1], sequenceSize);
			} else if (lastLocationPositions[1] < sequenceSize && !hasTransgenic && !isSourceFocuswithFullSequenceCoverage) {
				reportCoverageError(result, firstSourceOrigin, MESSAGE_ID_SHORT, firstLocation[1], sequenceSize);
			}
		}
        return result;
    }
844289
public boolean validate()
  {
    boolean correct = true;
    if (population() > 1)
    {
      java.util.Comparator comp = index().insertComparator();
      int xcc = 0;
      for (int i = 0; i < population()-1; i++)
      {
        xcc = comp.compare(_nodeKey[i], _nodeKey[i+1]);
        if ( !(xcc < 0) )
          {
            System.out.println("Entry " + i + " not less than entry " + i+1);
            correct = false;
          }
      }
    }
    return correct;
  }
1121512
public Object process(InvocableMap.Entry entry) {
        Object oldValue = fReturnOld ? entry.getValue() : null;
        entry.remove(false);
        return oldValue;
    }
205110
protected List<ValidationPlanResult> validateEntriesInReader(Writer writer,File targetFile,ArrayList<Object> entryList)
	{

		List<ValidationPlanResult> validationResults = new ArrayList<ValidationPlanResult>();

		try
		{
			int currentEntryCount = 0;
			Object entry = getNextEntryFromReader(writer);
			if (entryList != null)
				entryList.add(entry);
			PrintWriter origFileWriter = null;
			PrintWriter fixedFileWriter = null;
			/**
			 * we write fixed files (if we are fixing) to a temp file, then
			 * replace the original file once we have finished reading the
			 * original file
			 */
			File fixedTempFile = new File("./fixedFile_temp.del");

			String diagnosisDir = "diagnosis";

			/**
			 * for files with errors, we split the original file rather than
			 * write it using the writer, this ensures we have an exact copy of
			 * the original.
			 */
			String[] splitEntries = null;
			String fileString = null;
			if (filterMode && filterPrefix != null && !FileType.GFF3.equals(fileType))
			{
				File originalFile = new File(targetFile.getPath());
				fileString = FileUtils.readFile(new FileInputStream(originalFile));
				fileString = fileString.trim();
				splitEntries = fileString.split("//");
			}

			if (fixDiagnoseMode)
			{
				File diagnoseDir = new File("./" + diagnosisDir);
				if (!diagnoseDir.exists())
				{
					diagnoseDir.mkdirs();
				}
				origFileWriter = new PrintWriter(new File(diagnosisDir + File.separator + targetFile.getName() + "_orig.txt"),"UTF-8");
				fixedFileWriter = new PrintWriter(new File(diagnosisDir+ File.separator + targetFile.getName() + "_fixed.txt"),"UTF-8");
			}
			else
				if (fixMode)
				{
					fixedFileWriter = new PrintWriter(fixedTempFile,"UTF-8");
					String originalDirString = prefix == null ? "./original_files" : prefix + "_" + "original_files";
					File originalsDir = new File(originalDirString);
					System.out.println(originalsDir.getAbsolutePath());

					/**
					 * make the original file dir if does not exist
					 */
					if (!originalsDir.exists())
					{
						originalsDir.mkdirs();
					}

					/**
					 * make copies of the original files only if copies have not
					 * been made already
					 */
					File copyOfOriginal = new File(originalDirString + File.separator + targetFile.getName());
					if (!copyOfOriginal.exists())
					{
						FileUtils.copyFile(	targetFile,copyOfOriginal);

					}

				}

			/**
			 * total number of validation messages created
			 */
			int totalCount = 0;
			while (entry != null)
			{

				String originalFileString = null;

				/**
				 * if in diagnosis mode - need to make a copy of the entry
				 * before it gets fixed. Write the entry out to a string and
				 * keep it for writing if any fixes take place. We use the file
				 * writer rather than make a copy of the original file because
				 * we want the file writer to sort the feature table - making
				 * diffs easier to see when comparing with the fixed files.
				 */
				if (fixDiagnoseMode)

				{
					StringWriter stringWriter = new StringWriter();
					if (FileType.EMBL.equals(fileType) || FileType.GENBANK.equals(fileType))
						{

							Entry originalEntry = (Entry) reader.getEntry();
							EntryWriter entryWriter;
							if (FileType.EMBL.equals(fileType)||FileType.FASTA.equals(fileType))
							{
								entryWriter = new EmblEntryWriter(originalEntry);
							}
							else
							{
								entryWriter = new GenbankEntryWriter(originalEntry);
							}

							entryWriter.setWrapType(wrapType);
							entryWriter.write(stringWriter);

						}
					stringWriter.close();
					originalFileString = stringWriter.toString();
				}
				/**
				 * then validate and fix the entry
				 */
				ValidationPlanResult planResult = validateEntry(entry);
				if (targetFile != null)
				{
					planResult.setTargetOrigin(targetFile.getName());// set the validation target to be the file name
				}

				if (!suppressedErrorCodes.isEmpty())
				{
					for (String warningCode : suppressedErrorCodes)
					{
						planResult.removeMessages(warningCode);
					}
				}

				/**
				 * if we are rewriting de lines - do so here
				 */
				if (writeDeMode && entry instanceof Entry)
				{
					ValidationResult deValidationResult = DEGenerator.writeDE((Entry) entry);
					planResult.append(deValidationResult);
				}
				/**
				 * if we are sorting the files into good and bad - do so here
				 */
				if (filterMode && filterPrefix != null && !(FileType.GFF3.equals(fileType)))
				{

					if (!planResult.getMessages(Severity.ERROR).isEmpty())
					{
						if (splitEntries.length == 1)
						{
							badFilesWriter.write(fileString);
							badFilesWriter.flush();
						}
						else
						{
							String entryString = splitEntries[currentEntryCount];
							entryString = entryString.concat("\n//\n");// as we will have lost the original when splitting
							badFilesWriter.write(entryString.trim());
							badFilesWriter.flush();
						}

					}
					else
					{
						EntryWriter entryWriter = null;
						switch(fileType)
						{
						case EMBL:
						case FASTA:
						case AGP:
							entryWriter = new EmblEntryWriter((Entry) entry);
							break;
						case GENBANK:
							entryWriter = new GenbankEntryWriter((Entry) entry);
							break;
						default:
							break;
						}
						if(entryWriter!=null)
						entryWriter.write(goodFilesWriter);
					}
				}

				/**
				 * if we are fixing in diagnosis mode, see if there were fixes.
				 * if so, write the original and fixed files into the diagnosis
				 * directory.
				 */
				if (fixDiagnoseMode)
				{
					if (!planResult.getMessages(Severity.FIX).isEmpty())
					{

						File diagnoseDir = new File("./" + diagnosisDir);
						if (!diagnoseDir.exists())
						{
							diagnoseDir.mkdirs();
						}

						if (originalFileString != null)
						{
							origFileWriter.write(originalFileString);
						}
							EntryWriter entryWriter;
							if (FileType.EMBL.equals(fileType)||FileType.FASTA.equals(fileType))
							{
								entryWriter = new EmblEntryWriter((Entry) entry);
							}
							else
							{
								entryWriter = new GenbankEntryWriter((Entry) entry);
							}
							entryWriter.setWrapType(wrapType);
							Entry Egentry = (Entry) entry;
							if (!Egentry.isDelete())
							{
								entryWriter.write(fixedFileWriter);
							}
						}
					
				}
				else
					if (fixMode)
					{
						EntryWriter entryWriter = null;
						Entry Egentry = (Entry) entry;
						switch(fileType)
						{
						case EMBL:
						case FASTA:
						case AGP:
							if (!Egentry.isDelete())
								entryWriter = new EmblEntryWriter((Entry) entry);
							break;
							
						case GENBANK:
								entryWriter = new GenbankEntryWriter((Entry) entry);
								break;
						default:
							break;
								
								
							}
						if(entryWriter!=null)
						{
						entryWriter.setWrapType(wrapType);
						entryWriter.write(fixedFileWriter);
						}
							
					}
					

				if (planResult.getMessages(Severity.FIX).size() > 0)
				{
					fixCount++;
				}
				if (planResult.getMessages(Severity.ERROR).size() > 0)
				{
					failCount++;
				}
				if (planResult.getMessages(Severity.FIX).size() == 0)
				{
					unchangedCount++;
				}

				/**
				 * writes to the report files
				 */
				writeResultsToFile(planResult);

				if (!lowMemoryMode)
				{
					validationResults.add(planResult);
					totalCount += planResult.count();
				}

				/**
				 * we go into low memory mode automatically past a certain
				 * threshold
				 */
				if (totalCount > LOW_MEMORY_THRESHOLD && !lowMemoryMode)
				{
					System.out.println("\n\nEntering low memory mode\n\n");
					lowMemoryMode = true;
					validationResults.clear();
					System.gc();
				}

				entry = getNextEntryFromReader(writer);
				if (entryList != null && entry != null)
					entryList.add((Entry) entry);
				totalEntryCount++;
				currentEntryCount++;
			}

			if (origFileWriter != null)
			{
				origFileWriter.close();
			}

			if (fixedFileWriter != null)
			{
				fixedFileWriter.close();

				if (fixMode)
				{
	    			FileUtils.copyFile(	fixedTempFile,targetFile);
					fixedTempFile.delete();
				}
			}

		}
		catch (Throwable e)
		{
			e.printStackTrace();
			printMessageLine(	"VALIDATOR FAILING",LOG_LEVEL_QUIET);
			System.exit(1);
		}

		return validationResults;
	}
356371
public ListInventoryEntriesResult withEntries(java.util.Collection<java.util.Map<String, String>> entries) {
        setEntries(entries);
        return this;
    }
798238
public Object process(BinaryEntry entry) {
        Object result = processEntry(entry);
        return result == NO_RESULT ? null : result;
    }
844614
@SuppressWarnings("unchecked")
	public ValidationPlanResult execute(ValidationCheck check, Object target) throws ValidationEngineException {
		
		
		if (check == null)
		{
			return validationPlanResult;
		}
		try
		{
		 check.setEmblEntryValidationPlanProperty(planProperty);
		 if(planProperty.enproConnection.get()!=null&&entryDAOUtils==null)
		 {
			 entryDAOUtils=new EntryDAOUtilsImpl(planProperty.enproConnection.get(),true);
		 }
		 check.setEntryDAOUtils(entryDAOUtils);
		 if(planProperty.eraproConnection.get()!=null&&eraproDAOUtils==null)
		 {
			 eraproDAOUtils = new EraproDAOUtilsImpl(planProperty.eraproConnection.get());
		 }
		 
		check.setEraproDAOUtils(eraproDAOUtils);
		}catch(Exception e)
		{
			throw new ValidationEngineException(e);
		}
		//long start= System.currentTimeMillis();
		Class<? extends ValidationCheck> checkClass = check.getClass();
		ExcludeScope excludeScopeAnnotation = checkClass.getAnnotation(ExcludeScope.class);
		RemoteExclude remoteExclude = checkClass.getAnnotation(RemoteExclude.class);
		Description descAnnotation = checkClass.getAnnotation(Description.class);
		GroupIncludeScope groupIncludeAnnotation = checkClass.getAnnotation(GroupIncludeScope.class);

		if(remoteExclude!=null&&remote)
		{
			return validationPlanResult;
		}
        if (excludeScopeAnnotation != null && isInValidationScope(excludeScopeAnnotation.validationScope())) {
			return validationPlanResult;
		}
        
        if(groupIncludeAnnotation!=null && !isInValidationScopeGroup(groupIncludeAnnotation.group()))
        {
        	return validationPlanResult;
        }


        // inject data sets
        /*if(null != checkDataSetAnnotation) {
			Stream.of(checkDataSetAnnotation.dataSetNames()).forEach( dsName -> GlobalDataSets.loadIfNotExist(dsName, dataManager, fileManager, devMode));
        }
*/
        validationPlanResult.append(check.check(target));

        if (excludeScopeAnnotation != null) {
            demoteSeverity(validationPlanResult, excludeScopeAnnotation.maxSeverity());
        }
        if(groupIncludeAnnotation!=null)
        {
        	demoteSeverity(validationPlanResult, groupIncludeAnnotation.maxSeverity());
        }

//        System.out.println(this.result.count());
        
        return validationPlanResult;
	}
1098181
public List<Problem> validate(TypeElement type) {
		List<Problem> problems = new ArrayList<Problem>();
		boolean declared = false;
		int constructor = 0;
		List<Element> keys = new ArrayList<Element>();
		
		for (Element element : type.getEnclosedElements()) {
			ElementKind kind = element.getKind();
			
			if (kind == ElementKind.CONSTRUCTOR) {
				constructor++;
				
				if (((ExecutableElement) element).getParameters().isEmpty()) {
					if (element.getModifiers().contains(Modifier.PUBLIC)) {
						declared = true;
					}
				}
				
			} else if (kind == ElementKind.FIELD) {
				for (AnnotationMirror mirror : element.getAnnotationMirrors()) {
					Name name = ((TypeElement) mirror.getAnnotationType()
							.asElement()).getQualifiedName();
					
					if (name.contentEquals(KEY)) {
						keys.add(element);
						break;
					}
				}
			}
		}
		
		if (!declared && constructor > 0) {
			problems.add(new Problem(Kind.ERROR,
					"Entity class must have a public default constructor", type));
			return problems;
		}
		
		if (keys.isEmpty()) {
			problems.add(new Problem(Kind.ERROR,
					"Entity class must have one @Key property", type));
			return problems;
		} else if (keys.size() > 1) {
			for (Element key : keys) {
				problems.add(new Problem(Kind.ERROR,
						"@Key cannot be annotated on multiple properties", key));
			}
			
			return problems;
		}
		
		VariableElement variableElement = (VariableElement) keys.get(0);
		TypeMirror mirror = variableElement.asType();
		Element element = (mirror.getKind().isPrimitive()) 
				? types.boxedClass((PrimitiveType) mirror) : types.asElement(mirror);
		Name name = ((TypeElement) element).getQualifiedName();
		
		if (!name.contentEquals(JAVA_LANG_LONG)
				&& !name.contentEquals(JAVA_LANG_STRING)
				&& !name.contentEquals(LONG)) {
			problems.add(new Problem(Kind.ERROR, "@Key property must be ["
					+ JAVA_LANG_STRING + "] or [" + JAVA_LANG_LONG + "] or [" + LONG + "]", variableElement));
		}
		
		return problems;
	}
164556
function _validateFrame(entry) {
        var deferred = new $.Deferred(),
            fileEntry = FileSystem.getFileForPath(entry.filePath);

        if (entry.inMem) {
            var indexInWS = MainViewManager.findInWorkingSet(entry.paneId, entry.filePath);
            // Remove entry if InMemoryFile is not found in Working set
            if (indexInWS === -1) {
                deferred.reject();
            } else {
                deferred.resolve();
            }
        } else {
            fileEntry.exists(function (err, exists) {
                if (!err && exists) {
                    // Additional check to handle external modification and mutation of the doc text affecting markers
                    if (fileEntry._hash !== entry._hash) {
                        deferred.reject();
                    } else if (!entry._validateMarkers()) {
                        deferred.reject();
                    } else {
                        deferred.resolve();
                    }
                } else {
                    deferred.reject();
                }
            });
        }

        return deferred.promise();
    }
715392
@Override
  public void addEntry(String logType, LogEntry entry) {
    if (!logTypesToInclude.contains(logType)) {
      return;
    }

    if (!localLogs.containsKey(logType)) {
      List<LogEntry> entries = new ArrayList<>();
      entries.add(entry);
      localLogs.put(logType, entries);
    } else {
      localLogs.get(logType).add(entry);
    }
  }
1313136
private static int compareEntry(ArrayList<Entry> entries, int entry, int target) {
    return entries.get(entry).getGeneratedColumn() - target;
  }