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

False positive findings for imports that are referenced in KDOC #1326

Closed
WebTiger89 opened this issue May 29, 2022 · 2 comments · Fixed by #1368
Closed

False positive findings for imports that are referenced in KDOC #1326

WebTiger89 opened this issue May 29, 2022 · 2 comments · Fixed by #1368
Assignees
Labels
bug Something isn't working
Milestone

Comments

@WebTiger89
Copy link

WebTiger89 commented May 29, 2022

[UNUSED_IMPORT] unused imports should be removed: java.io.IOException - unused import

example:

import java.io.IOException

interface BluetoothApi {
    
    /**
     * Send array of bytes to bluetooth output stream.
     * This call is asynchronous.
     *
     * Note that this operation can still throw an [IOException] if the remote device silently
     * closes the connection so the pipe gets broken.
     *
     * @param bytes data to send
     * @return true if success, false if there was an error or device has been disconnected
     */
    fun trySend(bytes: ByteArray): Boolean
}
@WebTiger89 WebTiger89 added the bug Something isn't working label May 29, 2022
@orchestr7 orchestr7 added this to the 1.1.2 milestone May 30, 2022
@0x6675636b796f75676974687562
Copy link
Member

0x6675636b796f75676974687562 commented Jun 15, 2022

Bodies of @see tags may also be affected, e. g.:

import java.io.IOException
import java.io.IOException as IOE

interface BluetoothApi {
    /**
     * @see IOException
     * @see [IOException]
     * @see IOE
     * @see [IOE]
     */
    fun trySend(bytes: ByteArray): Boolean
}

Also, please remember that:

  1. inside the @see tags, [] are optional, and
  2. methods (not only classes) may be imported via aliases:
package com.example

import com.example.Library as Lib
import com.example.Library.doSmth as doSmthElse

object Library {
    fun doSmth(): Unit = TODO()
}

/**
 * @see Lib.doSmth
 * @see doSmthElse
 * @see [Lib.doSmth]
 * @see [doSmthElse]
 */
class Client

@nulls
Copy link
Member

nulls commented Jun 17, 2022

hi @WebTiger89,

Thanks for raising the issue. We fixed it.
It will be included to upcoming release

@nulls nulls modified the milestones: 1.1.2, 1.1.1 Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants