3

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-idea-cannot-quote-private-field-method.png

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

Allen Kerr
  • 153
  • 1
  • 6

2 Answers2

7

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. enter image description here

Olga Klisho
  • 1,206
  • 5
  • 7
0

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.

Matthew
  • 1,905
  • 3
  • 19
  • 26
Julien Maret
  • 579
  • 1
  • 4
  • 22