Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/software/amazon/ion/impl/IonReaderBinaryRawX.java
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ private final IonType load_annotation_start_with_value_type() throws IOException
if (_value_tid == UnifiedInputStreamX.EOF) {
throwErrorAt("unexpected EOF encountered where a type descriptor byte was expected");
}
if (_value_tid == PrivateIonConstants.tidTypedecl) {
throwErrorAt("An annotation wrapper may not contain another annotation wrapper.");
}

value_type = get_iontype_from_tid(_value_tid);
assert( value_type != null );
Expand Down
12 changes: 10 additions & 2 deletions src/software/amazon/ion/impl/LocalSymbolTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ private LocalSymbolTable(LocalSymbolTable other, int maxId)
importsList.add(systemSymbolTable);

IonType fieldType;
boolean foundImportList = false;
boolean foundLocalSymbolList = false;
while ((fieldType = reader.next()) != null)
{
if (reader.isNullValue()) continue;
Expand All @@ -314,8 +316,6 @@ private LocalSymbolTable(LocalSymbolTable other, int maxId)
sid = getSidForSymbolTableField(fieldName);
}

// TODO amzn/ion-java#35 If there's more than one 'symbols' or 'imports'
// field, they will be merged together.
// TODO amzn/ion-java#36 Switching over SIDs doesn't cover the case
// where the relevant field names are defined by a prev LST;
// the prev LST could have 'symbols' defined locally with a
Expand All @@ -326,6 +326,10 @@ private LocalSymbolTable(LocalSymbolTable other, int maxId)
{
// As per the Spec, other field types are treated as
// empty lists
if(foundLocalSymbolList){
throw new IonException("Multiple symbol tables found.");
}
foundLocalSymbolList = true;
if (fieldType == IonType.LIST)
{
reader.stepIn();
Expand All @@ -350,6 +354,10 @@ private LocalSymbolTable(LocalSymbolTable other, int maxId)
}
case IMPORTS_SID:
{
if(foundImportList){
throw new IonException("Multiple import tables found.");
}
foundImportList = true;
if (fieldType == IonType.LIST)
{
prepImportsList(importsList, reader, catalog);
Expand Down
3 changes: 1 addition & 2 deletions test/software/amazon/ion/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ public boolean accept(File dir, String name)

public static final FilenameFilter GLOBAL_SKIP_LIST =
new FileIsNot(
"bad/annotationNested.10n" // TODO amzn/ion-java#55
, "bad/clobWithNullCharacter.ion" // TODO amzn/ion-java#43
"bad/clobWithNullCharacter.ion" // TODO amzn/ion-java#43
, "bad/clobWithNonAsciiCharacter.ion" // TODO amzn/ion-java#99
, "bad/structOrderedEmpty.10n" // TODO amzn/ion-java#100
, "bad/symbolIDUnmapped.ion" // TODO amzn/ion-java#101
Expand Down