Skip to content

Commit 62270b5

Browse files
committed
Minor clean up
1 parent 4dbffff commit 62270b5

10 files changed

+15
-15
lines changed

src/main/kotlin/graphql/kickstart/tools/DictionaryTypeResolver.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ internal class InterfaceTypeResolver(
4444
types: List<GraphQLObjectType>
4545
) : DictionaryTypeResolver(
4646
dictionary,
47-
types.filter { it.interfaces.any { it.name == thisInterface.name } }.associateBy { it.name }
47+
types.filter { type -> type.interfaces.any { it.name == thisInterface.name } }.associateBy { it.name }
4848
) {
4949
override fun getError(name: String) = "Expected object type with name '$name' to implement interface '${thisInterface.name}', but it doesn't!"
5050
}

src/main/kotlin/graphql/kickstart/tools/SchemaParser.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ class SchemaParser internal constructor(
274274
if (nestedUnion != null) {
275275
leafObjects.addAll(getLeafUnionObjects(nestedUnion, types))
276276
} else {
277-
leafObjects.add(types.find { it.name == typeName }
277+
leafObjects.add(types.find { type -> type.name == typeName }
278278
?: throw SchemaError("Expected object type '$typeName' for union type '$name', but found none!"))
279279
}
280280
}
@@ -386,7 +386,7 @@ class SchemaParser internal constructor(
386386
* Returns an optional [String] describing a deprecated field/enum.
387387
* If a deprecation directive was defined using the @deprecated directive,
388388
* then a String containing either the contents of the 'reason' argument, if present, or a default
389-
* message defined in [DEFAULT_DEPRECATION_MESSAGE] will be returned. Otherwise, [null] will be returned
389+
* message defined in [DEFAULT_DEPRECATION_MESSAGE] will be returned. Otherwise, `null` will be returned
390390
* indicating no deprecation directive was found within the directives list.
391391
*/
392392
private fun getDeprecated(directives: List<Directive>): String? =

src/main/kotlin/graphql/kickstart/tools/SchemaParserOptions.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ data class SchemaParserOptions internal constructor(
153153
}
154154
}
155155

156-
internal class DefaultCoroutineContextProvider(val coroutineContext: CoroutineContext) : CoroutineContextProvider {
156+
internal class DefaultCoroutineContextProvider(private val coroutineContext: CoroutineContext) : CoroutineContextProvider {
157157
override fun provide(): CoroutineContext {
158158
return coroutineContext
159159
}

src/main/kotlin/graphql/kickstart/tools/proxy/Spring4AopProxyHandler.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import org.springframework.aop.support.AopUtils
88
*/
99
class Spring4AopProxyHandler : ProxyHandler {
1010

11-
val isEnabled: Boolean =
11+
private val isEnabled: Boolean =
1212
try {
1313
Class.forName("org.springframework.aop.support.AopUtils")
1414
true

src/main/kotlin/graphql/kickstart/tools/scanner/MethodFieldResolver.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ private inline fun invoke(method: Method, instance: Any, args: Array<Any?>): Any
266266
throw e
267267
}
268268

269-
throw java.lang.reflect.UndeclaredThrowableException(e);
269+
throw java.lang.reflect.UndeclaredThrowableException(e)
270270
}
271271
}
272272

src/main/kotlin/graphql/kickstart/tools/scanner/PropertyFieldResolver.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal class PropertyFieldResolver(
1313
field: FieldDefinition,
1414
search: FieldResolverScanner.Search,
1515
options: SchemaParserOptions,
16-
val property: Field
16+
private val property: Field
1717
) : FieldResolver(field, search, options, property.declaringClass) {
1818

1919
override fun createDataFetcher(): DataFetcher<*> {

src/main/kotlin/graphql/kickstart/tools/scanner/PropertyMapResolver.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ internal class PropertyMapResolver(
1919
relativeTo: JavaType
2020
) : FieldResolver(field, search, options, relativeTo) {
2121

22-
var mapGenericValue: JavaType = getMapGenericType(relativeTo)
22+
private var mapGenericValue: JavaType = getMapGenericType(relativeTo)
2323

2424
/**
2525
* Takes a type which implements Map and tries to find the
2626
* value type of that map. For some reason, mapClass is losing
2727
* its generics somewhere along the way and is always a raw
2828
* type.
2929
*/
30-
fun getMapGenericType(mapClass: JavaType): JavaType {
30+
private fun getMapGenericType(mapClass: JavaType): JavaType {
3131
val resolvedType = TypeResolver().resolve(mapClass)
3232
val typeParameters = resolvedType.typeParametersFor(Map::class.java)
3333

@@ -47,7 +47,7 @@ internal class PropertyMapResolver(
4747

4848
internal class PropertyMapResolverDataFetcher(
4949
private val sourceResolver: SourceResolver,
50-
val key: String
50+
private val key: String
5151
) : DataFetcher<Any> {
5252

5353
override fun get(environment: DataFetchingEnvironment): Any? {

src/main/kotlin/graphql/kickstart/tools/scanner/RootTypeInfo.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import graphql.language.TypeName
77
* @author Andrew Potter
88
*/
99
internal class RootTypeInfo private constructor(
10-
val queryType: TypeName?,
11-
val mutationType: TypeName?,
12-
val subscriptionType: TypeName?
10+
private val queryType: TypeName?,
11+
private val mutationType: TypeName?,
12+
private val subscriptionType: TypeName?
1313
) {
1414
companion object {
1515
const val DEFAULT_QUERY_NAME = "Query"

src/main/kotlin/graphql/kickstart/tools/scanner/SchemaClassScanner.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ internal class SchemaClassScanner(
234234
val resolverInfo: ResolverInfo = (if (resolverInfoList.size > 1) {
235235
MultiResolverInfo(resolverInfoList)
236236
} else {
237-
if (item.clazz.equals(Object::class.java)) {
237+
if (item.clazz == Object::class.java) {
238238
getResolverInfoFromTypeDictionary(item.type.name)
239239
} else {
240240
resolverInfosByDataClass[item.clazz] ?: DataClassResolverInfo(item.clazz)

src/main/kotlin/graphql/kickstart/tools/util/ParameterizedTypeImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private void validateConstructorArguments() {
5858
throw new MalformedParameterizedTypeException();
5959
}
6060
for (int i = 0; i < actualTypeArguments.length; i++) {
61-
// check actuals against formals' bounds
61+
// TODO check actual against formal bounds
6262
}
6363
}
6464

0 commit comments

Comments
 (0)