/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License 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.
 */

package androidx.room.solver.prepared.binderprovider

import androidx.room.parser.ParsedQuery
import androidx.room.processor.Context
import androidx.room.solver.prepared.binder.InstantPreparedQueryResultBinder
import javax.lang.model.type.DeclaredType

class InstantPreparedQueryResultBinderProvider(
    val context: Context
) : PreparedQueryResultBinderProvider {

    override fun matches(declared: DeclaredType) = true

    override fun provide(
        declared: DeclaredType,
        query: ParsedQuery
    ) = InstantPreparedQueryResultBinder(
        context.typeAdapterStore.findPreparedQueryResultAdapter(declared.enclosingType, query)
    )
}
/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License 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.
 */

package androidx.room.solver.prepared.binderprovider

import androidx.room.parser.ParsedQuery
import androidx.room.processor.Context
import androidx.room.solver.prepared.binder.InstantPreparedQueryResultBinder
import javax.lang.model.type.DeclaredType

class InstantPreparedQueryResultBinderProvider(
    val context: Context
) : PreparedQueryResultBinderProvider {

    override fun matches(declared: DeclaredType) = true

    override fun provide(
        declared: DeclaredType,
        query: ParsedQuery
    ) = InstantPreparedQueryResultBinder(
        context.typeAdapterStore.findPreparedQueryResultAdapter(declared, query)
    )
}
Remove unnecessary superclass usage in Instant result binder provider
Remove unnecessary superclass usage in Instant result binder provider

It is a mystery why this code is calling enclosing type.
Changing it does not fail any tests and also it is the only place
we get supertype from a declared type so removing it simplifies
the XDeclaredType abstraction

Bug: 160323720
Test: existing test suite
Change-Id: Ide8e0fb8bce72181a8f8eb8d9ad7f6ca611a0ba9

AndroidX/androidx,AndroidX/androidx,androidx/androidx,AndroidX/androidx,androidx/androidx,androidx/androidx,AndroidX/androidx,androidx/androidx,AndroidX/androidx,androidx/androidx,androidx/androidx,AndroidX/androidx,AndroidX/androidx,androidx/androidx,androidx/androidx,AndroidX/androidx,AndroidX/androidx,androidx/androidx,androidx/androidx,AndroidX/androidx