Skip to content

Commit 7c75c31

Browse files
remove internal modifiers from JvmType hierarchy (#312)
1 parent 23a106b commit 7c75c31

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

jacodb-core/src/main/kotlin/org/jacodb/impl/types/JcGenericTypes.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class JcBoundedWildcardImpl(
8181

8282
class JcTypeVariableImpl(
8383
override val classpath: JcClasspath,
84-
private val declaration: JcTypeVariableDeclaration,
84+
val declaration: JcTypeVariableDeclaration,
8585
override val nullable: Boolean?,
8686
override val annotations: List<JcAnnotation> = listOf()
8787
) : JcTypeVariable {

jacodb-core/src/main/kotlin/org/jacodb/impl/types/JcTypeBindings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ internal fun JcClasspath.typeOf(jvmType: JvmType, parameters: List<JvmType>? = n
8383
class JcTypeVariableDeclarationImpl(
8484
override val symbol: String,
8585
private val classpath: JcClasspath,
86-
private val jvmBounds: List<JvmType>,
86+
val jvmBounds: List<JvmType>,
8787
override val owner: JcAccessible
8888
) : JcTypeVariableDeclaration {
8989
override val bounds: List<JcRefType> get() = jvmBounds.map { classpath.typeOf(it) as JcRefType }

jacodb-core/src/main/kotlin/org/jacodb/impl/types/signature/JvmTypeParameterDeclaration.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import org.jacodb.api.jvm.JcAccessible
2020
import org.jacodb.api.jvm.JvmType
2121
import org.jacodb.api.jvm.JvmTypeParameterDeclaration
2222

23-
internal class JvmTypeParameterDeclarationImpl(
23+
class JvmTypeParameterDeclarationImpl(
2424
override val symbol: String,
2525
override val owner: JcAccessible,
2626
override val bounds: List<JvmType>? = null

jacodb-core/src/main/kotlin/org/jacodb/impl/types/signature/JvmTypes.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ sealed class AbstractJvmType(
5252

5353
}
5454

55-
internal sealed class JvmRefType(isNullable: Boolean?, annotations: List<JcAnnotation>)
55+
sealed class JvmRefType(isNullable: Boolean?, annotations: List<JcAnnotation>)
5656
: AbstractJvmType(isNullable, annotations)
5757

58-
internal class JvmArrayType(val elementType: JvmType, isNullable: Boolean? = null, annotations: List<JcAnnotation>)
58+
class JvmArrayType(val elementType: JvmType, isNullable: Boolean? = null, annotations: List<JcAnnotation>)
5959
: JvmRefType(isNullable, annotations) {
6060

6161
override val displayName: String
6262
get() = elementType.displayName + "[]"
6363

6464
}
6565

66-
internal class JvmParameterizedType(
66+
class JvmParameterizedType(
6767
val name: String,
6868
val parameterTypes: List<JvmType>,
6969
isNullable: Boolean? = null,
@@ -88,7 +88,7 @@ internal class JvmParameterizedType(
8888

8989
}
9090

91-
internal class JvmClassRefType(val name: String, isNullable: Boolean? = null, annotations: List<JcAnnotation>)
91+
class JvmClassRefType(val name: String, isNullable: Boolean? = null, annotations: List<JcAnnotation>)
9292
: JvmRefType(isNullable, annotations) {
9393

9494
override val displayName: String
@@ -105,7 +105,7 @@ internal class JvmClassRefType(val name: String, isNullable: Boolean? = null, an
105105
* This is important to properly handle nullability during substitutions. Not that kt T and java @NotNull T still have
106106
* differences -- see comment for `JcSubstitutorImpl.relaxNullabilityAfterSubstitution` for more details
107107
*/
108-
internal class JvmTypeVariable(val symbol: String, isNullable: Boolean? = null, annotations: List<JcAnnotation>)
108+
class JvmTypeVariable(val symbol: String, isNullable: Boolean? = null, annotations: List<JcAnnotation>)
109109
: JvmRefType(isNullable, annotations) {
110110

111111
constructor(declaration: JvmTypeParameterDeclaration, isNullable: Boolean? = null, annotations: List<JcAnnotation>) : this(
@@ -141,30 +141,30 @@ internal class JvmTypeVariable(val symbol: String, isNullable: Boolean? = null,
141141
}
142142

143143
// Nullability has no sense in wildcards, so we suppose them to be always nullable for definiteness
144-
internal sealed class JvmWildcard : AbstractJvmType(isNullable = true, listOf())
144+
sealed class JvmWildcard : AbstractJvmType(isNullable = true, listOf())
145145

146-
internal sealed class JvmBoundWildcard(val bound: JvmType) : JvmWildcard() {
146+
sealed class JvmBoundWildcard(val bound: JvmType) : JvmWildcard() {
147147

148-
internal class JvmUpperBoundWildcard(boundType: JvmType) : JvmBoundWildcard(boundType) {
148+
class JvmUpperBoundWildcard(boundType: JvmType) : JvmBoundWildcard(boundType) {
149149
override val displayName: String
150150
get() = "? extends ${bound.displayName}"
151151

152152
}
153153

154-
internal class JvmLowerBoundWildcard(boundType: JvmType) : JvmBoundWildcard(boundType) {
154+
class JvmLowerBoundWildcard(boundType: JvmType) : JvmBoundWildcard(boundType) {
155155
override val displayName: String
156156
get() = "? super ${bound.displayName}"
157157

158158
}
159159
}
160160

161-
internal object JvmUnboundWildcard : JvmWildcard() {
161+
object JvmUnboundWildcard : JvmWildcard() {
162162

163163
override val displayName: String
164164
get() = "*"
165165
}
166166

167-
internal class JvmPrimitiveType(val ref: String, annotations: List<JcAnnotation> = listOf())
167+
class JvmPrimitiveType(val ref: String, annotations: List<JcAnnotation> = listOf())
168168
: JvmRefType(isNullable = false, annotations) {
169169

170170
companion object {
@@ -189,7 +189,7 @@ internal class JvmPrimitiveType(val ref: String, annotations: List<JcAnnotation>
189189

190190
}
191191

192-
internal interface JvmTypeVisitor<ContextType> {
192+
interface JvmTypeVisitor<ContextType> {
193193
fun visitType(type: JvmType, context: ContextType): JvmType {
194194
return when (type) {
195195
is JvmPrimitiveType -> type

0 commit comments

Comments
 (0)