public static void assertFieldIsNotArrayOrInArray(final JBBPNamedFieldInfo fieldToCheck, final List<JBBPNamedFieldInfo> namedFieldList, final byte[] compiledScript) {
    // check that the field is not array
    if ((compiledScript[fieldToCheck.getFieldOffsetInCompiledBlock()] & FLAG_ARRAY) != 0) {
      throw new JBBPCompilationException("An Array field can't be used as array size [" + fieldToCheck.getFieldPath() + ']');
    }
    if (fieldToCheck.getFieldPath().indexOf('.') >= 0) {
      // the field in structure, check that the structure is not an array or not in an array
      final String[] splittedFieldPath = JBBPUtils.splitString(fieldToCheck.getFieldPath(), '.');
      final StringBuilder fieldPath = new StringBuilder();
      // process till the field name because we have already checked the field
      for (int i = 0; i < splittedFieldPath.length - 1; i++) {
        if (fieldPath.length() != 0) {
          fieldPath.append('.');
        }
        fieldPath.append(splittedFieldPath[i]);
        final JBBPNamedFieldInfo structureEnd = JBBPCompilerUtils.findForFieldPath(fieldPath.toString(), namedFieldList);
        if ((compiledScript[structureEnd.getFieldOffsetInCompiledBlock()] & FLAG_ARRAY) != 0) {
          throw new JBBPCompilationException("Field from structure array can't be use as array size [" + fieldToCheck.getFieldPath() + ';' + structureEnd.getFieldPath() + ']');
        }
      }
    }
  }
public static void assertFieldIsNotArrayOrInArray ( final JBBPNamedFieldInfo fieldToCheck , final List < JBBPNamedFieldInfo > namedFieldList , final byte [ ] compiledScript ) { if ( ( compiledScript [ fieldToCheck . getFieldOffsetInCompiledBlock ( ) ] & FLAG_ARRAY ) != 0 ) { throw new JBBPCompilationException ( "An Array field can't be used as array size [" + fieldToCheck . getFieldPath ( ) + ']' ) ; } if ( fieldToCheck . getFieldPath ( ) . indexOf ( '.' ) >= 0 ) { final String [ ] splittedFieldPath = JBBPUtils . splitString ( fieldToCheck . getFieldPath ( ) , '.' ) ; final StringBuilder fieldPath = new StringBuilder ( ) ; for ( int i = 0 ; i < splittedFieldPath . length - 1 ; i ++ ) { if ( fieldPath . length ( ) != 0 ) { fieldPath . append ( '.' ) ; } fieldPath . append ( splittedFieldPath [ i ] ) ; final JBBPNamedFieldInfo structureEnd = JBBPCompilerUtils . findForFieldPath ( fieldPath . toString ( ) , namedFieldList ) ; if ( ( compiledScript [ structureEnd . getFieldOffsetInCompiledBlock ( ) ] & FLAG_ARRAY ) != 0 ) { throw new JBBPCompilationException ( "Field from structure array can't be use as array size [" + fieldToCheck . getFieldPath ( ) + ';' + structureEnd . getFieldPath ( ) + ']' ) ; } } } }
Check a field in a compiled list defined by its named field info, that the field is not an array and it is not inside a structure array.

@param fieldToCheck   a named field info to be checked, must not be null
@param namedFieldList a named field info list, must not be null.
@param compiledScript a compiled script body