简体   繁体   中英

Why can't I quote private field, method on javadoc in intellij-idea 2018.3.5?

A few days ago, I upgrade intellij-idea to version 2018.3.5,183.5912.21 on my computer. And I find this version isn't allowed to quote private filed, method on javadoc. That bother me a lot. In previous version, I can quote private field, method on javadoc.

For exmaple,

public class Foo {

  private static final int CONSTANT = 1;

  private Integer id;
  private String name;

  //ignore getter, setter, toString...

  private void doSth() {
  }
}

And I write javadoc on somewhere I use Foo, stackoverflow想法不能引用私有字段方法

How can I change the config of intellij-idea? Or is there other way to write javadoc?

Please go to Java | Javadoc | Declaration has problems in Javadoc references inspection and uncheck the Report inaccessible symbols option . So the references will not be highlighted as inaccessible. 在此处输入图片说明

I'm not using IntelliJ, but I can tell you that javadoc is created by the JDK. The IDE just makes the request easier. You can create private javadoc.

For IntelliJ just read this tutorial:

https://www.jetbrains.com/help/idea/working-with-code-documentation.html

You just have to move the slider from package to private to generate it.

Note: even if you don't generate it is still good to put javadoc in your private field and method. That's a good way to document and make code more understandable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM