Skip to content

Commit

Permalink
Marks Kotlin classes internal where possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
tgregg committed Oct 11, 2024
1 parent 7b9ae9c commit 86c2bce
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import com.amazon.ion.impl.macro.MacroRef.Companion.byName
* IonReaderContinuableCoreBinary.EncodingDirectiveReader should be moved to the top level and shared by both readers.
* If that were to happen, this class would no longer be needed.
*/
class EncodingDirectiveReader(private val reader: IonReader, readerAdapter: ReaderAdapter) {
internal class EncodingDirectiveReader(private val reader: IonReader, readerAdapter: ReaderAdapter) {

private var macroCompiler: MacroCompiler = MacroCompiler({ key: Any? -> newMacros[key] }, readerAdapter)
private var localMacroMaxOffset: Int = -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ public final int getFieldId()
id = getFieldNameSymbol().getSid();
} else {
// Superclass handles hoisting logic
id =super.getFieldId();
id = super.getFieldId();
}
if (id == SymbolTable.UNKNOWN_SYMBOL_ID)
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/amazon/ion/impl/macro/MacroCompiler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import com.amazon.ion.util.confirm
* [MacroCompiler] wraps an Ion reader. When directed to do so, it will take over advancing and getting values from the
* reader in order to read one [TemplateMacro].
*/
class MacroCompiler(
internal class MacroCompiler(
private val getMacro: (MacroRef) -> Macro?,
private val reader: ReaderAdapter
) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/amazon/ion/impl/macro/ReaderAdapter.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package com.amazon.ion.impl.macro

import com.amazon.ion.*
Expand All @@ -9,7 +11,7 @@ import java.math.BigInteger
* @see ReaderAdapterIonReader
* @see ReaderAdapterContinuable
*/
interface ReaderAdapter {
internal interface ReaderAdapter {

fun hasAnnotations(): Boolean
fun fieldNameSymbol(): SymbolToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import java.math.BigInteger
/**
* A [ReaderAdapter] that wraps an [IonReaderContinuableCore].
*/
class ReaderAdapterContinuable(val reader: IonReaderContinuableCore) : ReaderAdapter {
internal class ReaderAdapterContinuable(val reader: IonReaderContinuableCore) : ReaderAdapter {

// TODO: Make sure that we can throw exceptions if there's an over-sized value.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import java.math.BigInteger
/**
* A [ReaderAdapter] that wraps an [IonReader].
*/
class ReaderAdapterIonReader(val reader: IonReader) : ReaderAdapter {
internal class ReaderAdapterIonReader(val reader: IonReader) : ReaderAdapter {

// TODO performance: when there are annotations, this causes a redundant allocation if the allocations are
// later consumed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class MacroCompilerTest {
}
};

abstract fun newMacroCompiler(reader: IonReader, macros: ((MacroRef) -> Macro?)): MacroCompiler
internal abstract fun newMacroCompiler(reader: IonReader, macros: ((MacroRef) -> Macro?)): MacroCompiler
}

private fun newReader(source: String): IonReader {
Expand Down

0 comments on commit 86c2bce

Please sign in to comment.