I have a file called MyFile.java and it contains multiple classes(none of them is public). Note that the file does not contain MyFile class. Apparently Javadoc is not happy about this and it generates a warning saying file does not contain class com.example.MyClass
. A few solutions I looked into:
- Move classes into their own files. This looks like the proper way of fixing the warnings, but the new files won't obliviously have the source control history, so I am trying to avoid it.
- Create empty MyFile class. This is ugly.
- Hide Javadoc warnings, preferably per file. There is a high chance that this is not possible.
A few questions that I have:
- Why does Javadoc complain? I couldn't find any documentation, please point me to one. I think it is perfectly fine not to have a class with the same name as the file.
- Any other suggestions I can look into?
- Is it possible to hide warnings somehow?
additionalparam="-Xdoclint:none"
does not work.
Thank you all in advance
Copyright Notice:Content Author:「John」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50257769/javadoc-warning-bad-source-file-file-does-not-contain-class-com-example-mycla