Skip to content

Commit

Permalink
Removes some unused code. (#858)
Browse files Browse the repository at this point in the history
* initial code removal

* imports/copyright updates via spotless apply
  • Loading branch information
carljmosca authored and linlin-s committed Jul 3, 2024
1 parent 6fccb4e commit cd30dc1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 358 deletions.
23 changes: 5 additions & 18 deletions src/main/java/com/amazon/ion/impl/IonReaderTextRawTokensX.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.IonTokenConstsX.CharacterSequence.CHAR_SEQ_ESCAPED_NEWLINE_SEQUENCE_1;
Expand Down Expand Up @@ -1582,11 +1569,11 @@ protected IonType load_number(StringBuilder sb) throws IOException
int c2 = read_char();
if (Radix.HEX.isPrefix(c2)) {
sb.append((char)c);
c = loadRadixValue(sb, has_sign, c2, Radix.HEX);
c = loadRadixValue(sb, c2, Radix.HEX);
return load_finish_number(sb, c, IonTokenConstsX.TOKEN_HEX);
} else if (Radix.BINARY.isPrefix(c2)) {
sb.append((char) c);
c = loadRadixValue(sb, has_sign, c2, Radix.BINARY);
c = loadRadixValue(sb, c2, Radix.BINARY);
return load_finish_number(sb, c, IonTokenConstsX.TOKEN_BINARY);
}
// not a next value, back up and try again
Expand Down Expand Up @@ -1843,7 +1830,7 @@ else if (c == '+' || c == '-') {
return load_finish_number(sb, c, IonTokenConstsX.TOKEN_TIMESTAMP);
}

private final int loadRadixValue(StringBuilder sb, boolean has_sign, int c2, Radix radix)
private final int loadRadixValue(StringBuilder sb, int c2, Radix radix)
throws IOException
{
radix.assertPrefix(c2);
Expand Down
311 changes: 0 additions & 311 deletions src/main/java/com/amazon/ion/impl/IonTextBufferedStream.java

This file was deleted.

31 changes: 2 additions & 29 deletions src/main/java/com/amazon/ion/impl/UnifiedInputStreamX.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
/*
* 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 com.amazon.ion.impl.IonReaderTextRawTokensX.IonReaderTextTokenException;
import com.amazon.ion.impl.UnifiedSavePointManagerX.SavePoint;
import java.io.Closeable;
import java.io.IOException;
Expand Down Expand Up @@ -383,19 +369,6 @@ public final int read(byte[] dst, int offset, int length) throws IOException
}
return length - remaining;
}
private int read_utf8(int c) throws IOException
{
int len = IonUTF8.getUTF8LengthFromFirstByte(c);
for (int ii=1; ii<len; ii++) {
int c2 = read();
if (c2 == -1) {
throw new IonReaderTextTokenException("invalid UTF8 sequence encountered in stream");
}
c |= (c2 << (ii*8));
}
c = IonUTF8.getScalarFrom4BytesReversed(c);
return c;
}

/**
* the refill method is the key override that is filled in by
Expand Down

0 comments on commit cd30dc1

Please sign in to comment.