简体   繁体   English

为什么我不能在intellij-idea 2018.3.5中引用javadoc上的私有字段方法?

[英]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. 几天前,我在计算机上将intellij-idea升级到版本2018.3.5,183.5912.21。 And I find this version isn't allowed to quote private filed, method on javadoc. 而且我发现此版本不允许引用javadoc上的private filed方法。 That bother me a lot. 这让我很困扰。 In previous version, I can quote private field, method on javadoc. 在以前的版本中,我可以在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, 我在使用Foo的某个地方编写了Javadoc, stackoverflow想法不能引用私有字段方法

How can I change the config of intellij-idea? 如何更改intellij-idea的配置? Or is there other way to write javadoc? 还是有其他方法可以编写javadoc?

Please go to Java | 请转到Java | Javadoc | Javadoc | Declaration has problems in Javadoc references inspection and uncheck the Report inaccessible symbols option . 声明在Javadoc参考检查中存在问题,并取消选中“ 报告不可访问的符号”选项 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. 我没有使用IntelliJ,但是我可以告诉您javadoc是由JDK创建的。 The IDE just makes the request easier. IDE只是使请求更容易。 You can create private javadoc. 您可以创建私有javadoc。

For IntelliJ just read this tutorial: 对于IntelliJ,请阅读本教程:

https://www.jetbrains.com/help/idea/working-with-code-documentation.html 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. 注意:即使不生成,也可以将javadoc放在私有字段和方法中。 That's a good way to document and make code more understandable. 这是记录文档并使代码更易于理解的好方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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