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
18 changes: 2 additions & 16 deletions src/main/java/com/amazon/ion/apps/BaseApp.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
/*
* Copyright 2007-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package com.amazon.ion.apps;

import com.amazon.ion.IonCatalog;
import com.amazon.ion.IonException;
import com.amazon.ion.IonReader;
import com.amazon.ion.IonSystem;
import com.amazon.ion.SymbolTable;
import com.amazon.ion.impl._Private_IonConstants;
import com.amazon.ion.system.IonSystemBuilder;
import com.amazon.ion.system.SimpleCatalog;
import java.io.BufferedInputStream;
Expand Down
28 changes: 2 additions & 26 deletions src/main/java/com/amazon/ion/impl/IonWriterSystemBinary.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2007-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package com.amazon.ion.impl;

import static com.amazon.ion.impl._Private_IonConstants.tidDATAGRAM;
Expand Down Expand Up @@ -265,10 +252,8 @@ static long[] growOne(long[] source, int newSize) {
/** Ensure we don't use a closed {@link #output} stream. */
private boolean _closed;

private final static int TID_FOR_SYMBOL_TABLE_PATCH = _Private_IonConstants.tidDATAGRAM + 1;
private final static int DEFAULT_PATCH_COUNT = 10;
private final static int DEFAULT_PATCH_DEPTH = 10;
private final static int NOT_A_SYMBOL_TABLE_IDX = -1;

// Patch:
// offset in data stream
Expand Down Expand Up @@ -385,11 +370,6 @@ public final boolean isInStruct()
return _in_struct;
}

private final boolean topInStruct() {
if (_top == 0) return false;
boolean in_struct = _patch_in_struct[_patch_stack[_top - 1]];
return in_struct;
}
protected final boolean atDatagramLevel()
{
return (topType() == _Private_IonConstants.tidDATAGRAM);
Expand Down Expand Up @@ -440,10 +420,6 @@ final SymbolTable inject_local_symbol_table() throws IOException
return symbols;
}

private final int topLength() {
return _patch_lengths[_patch_stack[_top - 1]];
}

private final int topType() {
if (_top == 0) return _Private_IonConstants.tidDATAGRAM;
return _patch_types[_patch_stack[_top - 1]];
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/amazon/ion/impl/UnifiedInputStreamX.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ public final void skip(int skipDistance) throws IOException
+ getPosition();
throw new IOException(message);
}
return;
}
// NB this method does not follow the contract of InputStream.read, it will return 0 at EOF
// It is unclear what the implication to the rest of the system to make it 'conform'
Expand Down Expand Up @@ -478,7 +477,6 @@ private void set_current_page(int new_page_idx, UnifiedDataPageX new_page, int p

make_page_current(new_page, new_page_idx, pos, new_page.getBufferLimit());

return;
}
private int refill_is_eof() {
_eof = true;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/amazon/ion/impl/bin/IonEncoder_1_1.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package com.amazon.ion.impl.bin;

import com.amazon.ion.Decimal;
import com.amazon.ion.IonText;
import com.amazon.ion.IonType;
import com.amazon.ion.Timestamp;
import com.amazon.ion.impl.bin.utf8.Utf8StringEncoder;
import com.amazon.ion.impl.bin.utf8.Utf8StringEncoderPool;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;

import static com.amazon.ion.impl.bin.Ion_1_1_Constants.*;
import static java.lang.Double.doubleToRawLongBits;
Expand Down
32 changes: 2 additions & 30 deletions src/main/java/com/amazon/ion/impl/bin/IonRawBinaryWriter.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2007-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package com.amazon.ion.impl.bin;

import static com.amazon.ion.Decimal.isNegativeZero;
Expand Down Expand Up @@ -57,7 +44,6 @@
import java.math.BigInteger;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.NoSuchElementException;

/**
* Low-level binary {@link IonWriter} that understands encoding concerns but doesn't operate with any sense of symbol table management.
Expand Down Expand Up @@ -226,10 +212,6 @@ int numberOfLengthBytes() {
}
}

private static final byte STRING_TYPE_EXTENDED_LENGTH = (byte) 0x8E;
private static final byte[] STRING_TYPED_PREALLOCATED_2 = makeTypedPreallocatedBytes(0x8E, 2);
private static final byte[] STRING_TYPED_PREALLOCATED_3 = makeTypedPreallocatedBytes(0x8E, 3);

/** Max supported annotation length specifier size supported. */
private static final int MAX_ANNOTATION_LENGTH = 0x7F;

Expand Down Expand Up @@ -601,16 +583,6 @@ private void addPatchPoint(final ContainerInfo container, final long position, f
updateLength(patchLength - oldLength);
}

/**
* This is used to reclaim the placeholder patch point after scan the current container.
* @param placeholderPatchIndex represents the index of the placeholder patch point.
*/
private void reclaimPlaceholderPatchPoint(int placeholderPatchIndex) {
if (placeholderPatchIndex >= patchPoints.size() - 1) {
patchPoints.remove();
}
}

private ContainerInfo popContainer()
{
final ContainerInfo currentContainer = containers.pop();
Expand Down
23 changes: 2 additions & 21 deletions src/main/java/com/amazon/ion/impl/lite/IonTimestampLite.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2007-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package com.amazon.ion.impl.lite;

import com.amazon.ion.IonTimestamp;
Expand All @@ -32,12 +19,6 @@ final class IonTimestampLite
{
public final static Integer UTC_OFFSET = Timestamp.UTC_OFFSET;

private static final int BIT_FLAG_YEAR = 0x01;
private static final int BIT_FLAG_MONTH = 0x02;
private static final int BIT_FLAG_DAY = 0x04;
private static final int BIT_FLAG_MINUTE = 0x08;
private static final int BIT_FLAG_SECOND = 0x10;
private static final int BIT_FLAG_FRACTION = 0x20;
private static final int HASH_SIGNATURE =
IonType.TIMESTAMP.toString().hashCode();

Expand Down