includes/org/apache/poi/hssf/model/RecordOrderer.java
private static int findDataValidationTableInsertPos(List<RecordBase> records) {
		int i = records.size() - 1;
		if (!(records.get(i) instanceof EOFRecord)) {
			throw new IllegalStateException("Last sheet record should be EOFRecord");
		}
		while (i > 0) {
			i--;
			RecordBase rb = records.get(i);
			if (isDVTPriorRecord(rb)) {
				Record nextRec = (Record) records.get(i + 1);
				if (!isDVTSubsequentRecord(nextRec.getSid())) {
					throw new IllegalStateException("Unexpected (" + nextRec.getClass().getName()
							+ ") found after (" + rb.getClass().getName() + ")");
				}
				return i+1;
			}
			Record rec = (Record) rb;
			if (!isDVTSubsequentRecord(rec.getSid())) {
				throw new IllegalStateException("Unexpected (" + rec.getClass().getName()
						+ ") while looking for DV Table insert pos");
			}
		}
		return 0;
	}
/**
	 * Finds the index where the sheet validations header record should be inserted
	 * @param records the records for this sheet
	 *
	 * + WINDOW2
	 * o SCL
	 * o PANE
	 * oo SELECTION
	 * o STANDARDWIDTH
	 * oo MERGEDCELLS
	 * o LABELRANGES
	 * o PHONETICPR
	 * o Conditional Formatting Table
	 * o Hyperlink Table
	 * o Data Validity Table
	 * o SHEETLAYOUT
	 * o SHEETPROTECTION
	 * o RANGEPROTECTION
	 * + EOF
	 */
Finds the index where the sheet validations header record should be inserted
@param records the records for this sheet


Finds the index where the sheet validations header record should be inserted @param records the records for this sheet
private static int findDataValidationTableInsertPos(List<RecordBase> records) {
		int i = records.size() - 1;
		if (!(records.get(i) instanceof EOFRecord)) {
			throw new IllegalStateException("Last sheet record should be EOFRecord");
		}
		while (i > 0) {
			i--;
			RecordBase rb = records.get(i);
			if (isDVTPriorRecord(rb)) {
				Record nextRec = (Record) records.get(i + 1);
				if (!isDVTSubsequentRecord(nextRec.getSid())) {
					throw new IllegalStateException("Unexpected (" + nextRec.getClass().getName()
							+ ") found after (" + rb.getClass().getName() + ")");
				}
				return i+1;
			}
			Record rec = (Record) rb;
			if (!isDVTSubsequentRecord(rec.getSid())) {
				throw new IllegalStateException("Unexpected (" + rec.getClass().getName()
						+ ") while looking for DV Table insert pos");
			}
		}
		return 0;
	}
private static int findDataValidationTableInsertPos ( List < RecordBase > records ) { int i = records . size ( ) - 1 ; if ( ! ( records . get ( i ) instanceof EOFRecord ) ) { throw new IllegalStateException ( "Last sheet record should be EOFRecord" ) ; } while ( i > 0 ) { i -- ; RecordBase rb = records . get ( i ) ; if ( isDVTPriorRecord ( rb ) ) { Record nextRec = ( Record ) records . get ( i + 1 ) ; if ( ! isDVTSubsequentRecord ( nextRec . getSid ( ) ) ) { throw new IllegalStateException ( "Unexpected (" + nextRec . getClass ( ) . getName ( ) + ") found after (" + rb . getClass ( ) . getName ( ) + ")" ) ; } return i + 1 ; } Record rec = ( Record ) rb ; if ( ! isDVTSubsequentRecord ( rec . getSid ( ) ) ) { throw new IllegalStateException ( "Unexpected (" + rec . getClass ( ) . getName ( ) + ") while looking for DV Table insert pos" ) ; } } return 0 ; }
Finds the index where the sheet validations header record should be inserted
 @param records the records for this sheet
Finds the index where the sheet validations header record should be inserted @param records the records for this sheet