diff --git a/src/main/java/com/amazon/ion/apps/BaseApp.java b/src/main/java/com/amazon/ion/apps/BaseApp.java index 96ca1a5ea8..3dca74ddfe 100644 --- a/src/main/java/com/amazon/ion/apps/BaseApp.java +++ b/src/main/java/com/amazon/ion/apps/BaseApp.java @@ -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.apps; import com.amazon.ion.IonCatalog; @@ -20,7 +7,6 @@ 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; diff --git a/src/main/java/com/amazon/ion/impl/IonCursorBinary.java b/src/main/java/com/amazon/ion/impl/IonCursorBinary.java index 6166cfc381..2b01d173c8 100644 --- a/src/main/java/com/amazon/ion/impl/IonCursorBinary.java +++ b/src/main/java/com/amazon/ion/impl/IonCursorBinary.java @@ -943,10 +943,6 @@ private boolean slowReadFieldName_1_0() { /* ---- Ion 1.1 ---- */ - private long uncheckedReadVarUInt_1_1() { - throw new UnsupportedOperationException(); - } - private long slowReadVarUInt_1_1() { throw new UnsupportedOperationException(); } diff --git a/src/main/java/com/amazon/ion/impl/IonReaderContinuableApplicationBinary.java b/src/main/java/com/amazon/ion/impl/IonReaderContinuableApplicationBinary.java index 213c300415..dd78be4b87 100644 --- a/src/main/java/com/amazon/ion/impl/IonReaderContinuableApplicationBinary.java +++ b/src/main/java/com/amazon/ion/impl/IonReaderContinuableApplicationBinary.java @@ -11,7 +11,6 @@ import com.amazon.ion.ReadOnlyValueException; import com.amazon.ion.SymbolTable; import com.amazon.ion.SymbolToken; -import com.amazon.ion.SystemSymbols; import com.amazon.ion.UnknownSymbolException; import com.amazon.ion.ValueFactory; import com.amazon.ion.impl.bin.IntList; @@ -20,7 +19,6 @@ import java.io.IOException; import java.io.InputStream; -import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -42,13 +40,6 @@ */ class IonReaderContinuableApplicationBinary extends IonReaderContinuableCoreBinary implements IonReaderContinuableApplication { - // The UTF-8 encoded bytes representing the text `$ion_symbol_table`. - private static final byte[] ION_SYMBOL_TABLE_UTF8; - - static { - ION_SYMBOL_TABLE_UTF8 = SystemSymbols.ION_SYMBOL_TABLE.getBytes(StandardCharsets.UTF_8); - } - // An IonCatalog containing zero shared symbol tables. private static final IonCatalog EMPTY_CATALOG = new SimpleCatalog(); diff --git a/src/main/java/com/amazon/ion/impl/IonReaderContinuableCoreBinary.java b/src/main/java/com/amazon/ion/impl/IonReaderContinuableCoreBinary.java index df501feb7f..08181d5d1b 100644 --- a/src/main/java/com/amazon/ion/impl/IonReaderContinuableCoreBinary.java +++ b/src/main/java/com/amazon/ion/impl/IonReaderContinuableCoreBinary.java @@ -1,6 +1,5 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 - package com.amazon.ion.impl; import com.amazon.ion.Decimal; @@ -426,10 +425,6 @@ int readVarUInt_1_1() { throw new UnsupportedOperationException(); } - private int readVarSym_1_1(Marker marker) { - throw new UnsupportedOperationException(); - } - private BigDecimal readBigDecimal_1_1() { throw new UnsupportedOperationException(); } diff --git a/src/main/java/com/amazon/ion/impl/IonWriterSystemBinary.java b/src/main/java/com/amazon/ion/impl/IonWriterSystemBinary.java index 2b9dd26c73..06d66c38df 100644 --- a/src/main/java/com/amazon/ion/impl/IonWriterSystemBinary.java +++ b/src/main/java/com/amazon/ion/impl/IonWriterSystemBinary.java @@ -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; @@ -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 @@ -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); @@ -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]]; diff --git a/src/main/java/com/amazon/ion/impl/UnifiedInputStreamX.java b/src/main/java/com/amazon/ion/impl/UnifiedInputStreamX.java index 8356a9beea..2858ab3529 100644 --- a/src/main/java/com/amazon/ion/impl/UnifiedInputStreamX.java +++ b/src/main/java/com/amazon/ion/impl/UnifiedInputStreamX.java @@ -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' @@ -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; diff --git a/src/main/java/com/amazon/ion/impl/bin/IonEncoder_1_1.java b/src/main/java/com/amazon/ion/impl/bin/IonEncoder_1_1.java index 7b1ca9d4b2..a543a54b47 100644 --- a/src/main/java/com/amazon/ion/impl/bin/IonEncoder_1_1.java +++ b/src/main/java/com/amazon/ion/impl/bin/IonEncoder_1_1.java @@ -1,7 +1,8 @@ +// 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; @@ -9,7 +10,6 @@ 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; diff --git a/src/main/java/com/amazon/ion/impl/bin/IonRawBinaryWriter.java b/src/main/java/com/amazon/ion/impl/bin/IonRawBinaryWriter.java index 315d4bf204..e2073126c0 100644 --- a/src/main/java/com/amazon/ion/impl/bin/IonRawBinaryWriter.java +++ b/src/main/java/com/amazon/ion/impl/bin/IonRawBinaryWriter.java @@ -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; @@ -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. @@ -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; @@ -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(); diff --git a/src/main/java/com/amazon/ion/impl/lite/IonTimestampLite.java b/src/main/java/com/amazon/ion/impl/lite/IonTimestampLite.java index d7841c05fe..2eb8b4d791 100644 --- a/src/main/java/com/amazon/ion/impl/lite/IonTimestampLite.java +++ b/src/main/java/com/amazon/ion/impl/lite/IonTimestampLite.java @@ -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; @@ -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();