Skip to content

Commit 056ecb1

Browse files
authored
Clean up comments and paramter names (#386)
1 parent b77a5c8 commit 056ecb1

File tree

1 file changed

+31
-33
lines changed

1 file changed

+31
-33
lines changed

src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,7 +2143,7 @@ protected Collection<JavadocModule> getSourcePaths() throws MavenReportException
21432143
/*
21442144
* Should be after the source path (i.e. -sourcepath '.../src/main/java;.../src/main/javadoc') and *not*
21452145
* the opposite. If not, the javadoc tool always copies doc files, even if -docfilessubdirs is not
2146-
* setted.
2146+
* set.
21472147
*/
21482148
if (getJavadocDirectory() != null) {
21492149
File javadocDir = getJavadocDirectory();
@@ -2309,10 +2309,8 @@ protected final Collection<JavadocModule> getDependencySourcePaths() throws Mave
23092309
}
23102310

23112311
/**
2312-
* Returns a ArtifactFilter that only includes direct dependencies of this project
2312+
* Returns an ArtifactFilter that only includes direct dependencies of this project
23132313
* (verified via groupId and artifactId).
2314-
*
2315-
* @return
23162314
*/
23172315
private TransformableFilter createDependencyArtifactFilter() {
23182316
Set<Artifact> dependencyArtifacts = project.getDependencyArtifacts();
@@ -5600,12 +5598,12 @@ protected final OfflineLink getDefaultJavadocApiLink() {
56005598
}
56015599

56025600
/**
5603-
* Follows all of the given links if the Javadoc version is before 12, and returns their last
5604-
* redirect locations. Ordering is kept. This is necessary because javadoc tool doesn't follow
5601+
* Follows the given links if the Javadoc version is before 12, and returns their last
5602+
* redirect locations. Ordering is kept. This is necessary because the javadoc tool doesn't follow
56055603
* links, see JDK-8190312 (MJAVADOC-427, MJAVADOC-487)
56065604
*
5607-
* @param links Links to follow.
5608-
* @return Last redirect location of all the links.
5605+
* @param links Links to follow=
5606+
* @return last redirect location of all the links
56095607
*/
56105608
private Set<String> followLinks(Set<String> links) {
56115609
if (javadocRuntimeVersion.isAtLeast("12")) {
@@ -5757,23 +5755,23 @@ private boolean isJavadocVMInitError(String output) {
57575755
// ----------------------------------------------------------------------
57585756

57595757
/**
5760-
* @param p not null
5761-
* @return the javadoc link based on the project url i.e. <code>${project.url}/apidocs</code>.
5758+
* @param project not null
5759+
* @return the javadoc link based on the project URL i.e. <code>${project.url}/apidocs</code>.
57625760
* @since 2.6
57635761
*/
5764-
private static String getJavadocLink(MavenProject p) {
5765-
if (p.getUrl() == null) {
5762+
private static String getJavadocLink(MavenProject project) {
5763+
if (project.getUrl() == null) {
57665764
return null;
57675765
}
57685766

5769-
String url = cleanUrl(p.getUrl());
5767+
String url = cleanUrl(project.getUrl());
57705768

57715769
return url + "/apidocs";
57725770
}
57735771

57745772
/**
5775-
* @param url could be null.
5776-
* @return the url cleaned or empty if url was null.
5773+
* @param url could be null
5774+
* @return the cleaned URL or empty if url was null
57775775
* @since 2.6
57785776
*/
57795777
private static String cleanUrl(String url) {
@@ -5790,40 +5788,39 @@ private static String cleanUrl(String url) {
57905788
}
57915789

57925790
/**
5793-
* @param p not null
5791+
* @param project not null
57945792
* @param pluginId not null key of the plugin defined in {@link org.apache.maven.model.Build#getPluginsAsMap()}
57955793
* or in {@link org.apache.maven.model.PluginManagement#getPluginsAsMap()}
57965794
* @return the Maven plugin defined in <code>${project.build.plugins}</code> or in
5797-
* <code>${project.build.pluginManagement}</code>, or <code>null</code> if not defined.
5795+
* <code>${project.build.pluginManagement}</code>, or <code>null</code> if not defined
57985796
* @since 2.6
57995797
*/
5800-
private static Plugin getPlugin(MavenProject p, String pluginId) {
5801-
if ((p.getBuild() == null) || (p.getBuild().getPluginsAsMap() == null)) {
5798+
private static Plugin getPlugin(MavenProject project, String pluginId) {
5799+
if ((project.getBuild() == null) || (project.getBuild().getPluginsAsMap() == null)) {
58025800
return null;
58035801
}
58045802

5805-
Plugin plugin = p.getBuild().getPluginsAsMap().get(pluginId);
5803+
Plugin plugin = project.getBuild().getPluginsAsMap().get(pluginId);
58065804

58075805
if ((plugin == null)
5808-
&& (p.getBuild().getPluginManagement() != null)
5809-
&& (p.getBuild().getPluginManagement().getPluginsAsMap() != null)) {
5810-
plugin = p.getBuild().getPluginManagement().getPluginsAsMap().get(pluginId);
5806+
&& (project.getBuild().getPluginManagement() != null)
5807+
&& (project.getBuild().getPluginManagement().getPluginsAsMap() != null)) {
5808+
plugin = project.getBuild().getPluginManagement().getPluginsAsMap().get(pluginId);
58115809
}
58125810

58135811
return plugin;
58145812
}
58155813

58165814
/**
5817-
* @param p not null
5815+
* @param project the Maven project
58185816
* @param pluginId not null
58195817
* @param param not null
5820-
* @return the simple parameter as String defined in the plugin configuration by <code>param</code> key
5818+
* @return the string parameter defined in the plugin configuration by <code>param</code> key
58215819
* or <code>null</code> if not found.
58225820
* @since 2.6
58235821
*/
5824-
private static String getPluginParameter(MavenProject p, String pluginId, String param) {
5825-
// p.getGoalConfiguration( pluginGroupId, pluginArtifactId, executionId, goalId );
5826-
Plugin plugin = getPlugin(p, pluginId);
5822+
private static String getPluginParameter(MavenProject project, String pluginId, String param) {
5823+
Plugin plugin = getPlugin(project, pluginId);
58275824
if (plugin != null) {
58285825
Xpp3Dom xpp3Dom = (Xpp3Dom) plugin.getConfiguration();
58295826
if (xpp3Dom != null
@@ -5893,7 +5890,8 @@ protected final JavadocOptions buildJavadocOptions() throws IOException {
58935890
/**
58945891
* Override this if you need to provide a bundle attachment classifier, as in the case of test
58955892
* javadocs.
5896-
* @return The attachment classifier.
5893+
*
5894+
* @return the attachment classifier
58975895
*/
58985896
protected String getAttachmentClassifier() {
58995897
return JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER;
@@ -5902,8 +5900,8 @@ protected String getAttachmentClassifier() {
59025900
/**
59035901
* Logs an error with throwable content only if in debug.
59045902
*
5905-
* @param message The message which should be announced.
5906-
* @param t The throwable part of the message.
5903+
* @param message the message which should be announced
5904+
* @param t the throwable part of the message
59075905
*/
59085906
protected void logError(String message, Throwable t) {
59095907
if (getLog().isDebugEnabled()) {
@@ -5918,8 +5916,8 @@ protected List<MavenProject> getReactorProjects() {
59185916
}
59195917

59205918
/**
5921-
* @param prefix The prefix of the exception.
5922-
* @param e The exception.
5919+
* @param prefix the prefix of the exception
5920+
* @param e the exception
59235921
* @throws MojoExecutionException {@link MojoExecutionException} issue while generating report
59245922
*/
59255923
protected void failOnError(String prefix, Exception e) throws MojoExecutionException {

0 commit comments

Comments
 (0)