Source:
makeNewLocalSymbolTable(ValueFactory imageFactory, SymbolTable systemSymbolTable, IonCatalog catalog, IonReader reader, boolean isOnStruct) { if (! isOnStruct) { reader.next(); } assert reader.getType() == IonType.STRUCT : "invalid symbol table image passed in reader " + reader.getType() + " encountered when a struct was expected"; assert ION_SYMBOL_TABLE.equals(reader.getTypeAnnotations()[0]) : "local symbol tables must be annotated by " + ION_SYMBOL_TABLE; reader.stepIn(); List<String> symbolsList = new ArrayList<String>(); List<SymbolTable> importsList = new ArrayList<SymbolTable>(); importsList.add(systemSymbolTable); IonType fieldType; boolean foundImportList = false; boolean foundLocalSymbolList = false; while ((fieldType = reader.next()) != null) { if (reader.isNullValue()) continue; SymbolToken symTok = reader.getFieldNameSymbol(); int sid = symTok.getSid(); if (sid == SymbolTable.UNKNOWN_SYMBOL_ID) { final String fieldName = reader.getFieldName(); sid = getSidForSymbolTableField(fieldName); } switch (sid) { case SYMBOLS_SID: { if(foundLocalSymbolList){ throw new IonException("Multiple symbol tables found."); } foundLocalSymbolList = true; if (fieldType == IonType.LIST) { reader.stepIn(); IonType type; while ((type = reader.next()) != null) { final String text; if (type == IonType.STRING) { text = reader.stringValue(); } else { text = null; } symbolsList.add(text); } reader.stepOut(); } break; } case IMPORTS_SID: { if(foundImportList){ throw new IonException("Multiple import tables found."); } foundImportList = true; if (fieldType == IonType.LIST) { prepImportsList(importsList, reader, catalog); } break; } default: { break; } } } reader.stepOut(); LocalSymbolTableImports imports = new LocalSymbolTableImports(importsList); return new LocalSymbolTable(imageFactory, imports, symbolsList); }

Target:
makeNewLocalSymbolTable(ValueFactory imageFactory, SymbolTable systemSymbolTable, IonCatalog catalog, IonReader reader, boolean isOnStruct) { if (! isOnStruct) { reader.next(); } assert reader.getType() == IonType.STRUCT : "invalid symbol table image passed in reader " + reader.getType() + " encountered when a struct was expected"; assert ION_SYMBOL_TABLE.equals(reader.getTypeAnnotations()[0]) : "local symbol tables must be annotated by " + ION_SYMBOL_TABLE; reader.stepIn(); List<String> symbolsList = new ArrayList<String>(); List<SymbolTable> importsList = new ArrayList<SymbolTable>(); importsList.add(systemSymbolTable); IonType fieldType; boolean foundImportList = false; boolean foundLocalSymbolList = false; while ((fieldType = reader.next()) != null) { if (reader.isNullValue()) continue; SymbolToken symTok = reader.getFieldNameSymbol(); int sid = symTok.getSid(); if (sid == SymbolTable.UNKNOWN_SYMBOL_ID) { final String fieldName = reader.getFieldName(); sid = getSidForSymbolTableField(fieldName); } switch (sid) { case SYMBOLS_SID: { if(foundLocalSymbolList){ throw new IonException("Multiple symbol fields found within a single local symbol table."); } foundLocalSymbolList = true; if (fieldType == IonType.LIST) { reader.stepIn(); IonType type; while ((type = reader.next()) != null) { final String text; if (type == IonType.STRING) { text = reader.stringValue(); } else { text = null; } symbolsList.add(text); } reader.stepOut(); } break; } case IMPORTS_SID: { if(foundImportList){ throw new IonException("Multiple imports fields found within a single local symbol table."); } foundImportList = true; if (fieldType == IonType.LIST) { prepImportsList(importsList, reader, catalog); } break; } default: { break; } } } reader.stepOut(); LocalSymbolTableImports imports = new LocalSymbolTableImports(importsList); return new LocalSymbolTable(imageFactory, imports, symbolsList); }