Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug about Private class InternalApi is unused. #12

Closed
nuhkoca opened this issue Nov 16, 2019 · 2 comments
Closed

A bug about Private class InternalApi is unused. #12

nuhkoca opened this issue Nov 16, 2019 · 2 comments

Comments

@nuhkoca
Copy link

nuhkoca commented Nov 16, 2019

Hello,

I implemented Codefactor for one of my repositories. However, it mentions a weird issue.

Private class InternalApi is unused.

I have InternalApi annotation class and use it inside my class as follows:

DataModule.kt

@Retention(BINARY)
@Qualifier
private annotation class InternalApi

@Module
object DataModule {

    @InternalApi
    @Provides
    @Singleton
    internal fun provideGson(): Gson {
        return GsonBuilder().apply {
            setFieldNamingPolicy(UPPER_CAMEL_CASE_WITH_SPACES)
            serializeNulls()
            setLenient()
        }.create()
    }

    @InternalApi
    @Provides
    @Singleton
    internal fun provideHttpLoggingInterceptor(): HttpLoggingInterceptor {
        return HttpLoggingInterceptor().apply { level = Level.BODY }
    }

Could you please tell me how to solve this issue? Thanks,

@cordis-dev
Copy link
Contributor

cordis-dev commented Nov 17, 2019

@nuhkoca Thanks for reporting - this seems like a false positive coming from Detekt (reported). UnusedPrivateClass rule is now disabled as default until resolved by arturbosch/detekt.

@nuhkoca
Copy link
Author

nuhkoca commented Nov 17, 2019

Thanks for informing @cordis-dev now it works as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants