# javaClass to ::class.java migration problem

**URL:** <https://discuss.kotlinlang.org/t/javaclass-to-class-java-migration-problem/2292>\
**Category:** EAP\
**Created:** [February 18, 2017, 11:03pm UTC](https://discuss.kotlinlang.org/t/javaclass-to-class-java-migration-problem/2292 "2017-02-18T23:03:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jesi](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/jesi/32/1440_2.png) [@jesi](https://discuss.kotlinlang.org/u/jesi)\
**Post date:** [February 18, 2017, 11:03pm UTC](https://discuss.kotlinlang.org/t/javaclass-to-class-java-migration-problem/2292/1 "2017-02-18T23:03:21Z")

</div>

I’m trying to migrate to new RC version of Kotlin and found strange situation when eliminating deprecation warnings about .javaClass using.  
My code was:

> ``val memberProperties: Collection\<KProperty1\<T, \*\>\> = entity.javaClass.kotlin.memberProperties`

When I’ve changed it to:

> val memberProperties: Collection\<KProperty1\<T, \*\>\> = entity::class.java.kotlin.memberProperties

compiler says:  
`Error:(110, 89) Kotlin: Type inference failed. Expected type mismatch: inferred type is Collection<KProperty1<out T, Any?>> but Collection<KProperty1<T, *>> was expected`

If I change type of my `val` to `Collection<KProperty1<out T, *>>` - it compiles, but I can’t use elements of collection as:

> property.get(entity)

But by _ctrl+click_ to `memberProperties` in both variants they both have type of `Collection<KProperty1<T, *>>`.

How to migrate this place?
