Skip to content

Clean up comments and argument names #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,7 @@ protected Collection<JavadocModule> getSourcePaths() throws MavenReportException
/*
* Should be after the source path (i.e. -sourcepath '.../src/main/java;.../src/main/javadoc') and *not*
* the opposite. If not, the javadoc tool always copies doc files, even if -docfilessubdirs is not
* setted.
* set.
*/
if (getJavadocDirectory() != null) {
File javadocDir = getJavadocDirectory();
Expand Down Expand Up @@ -2322,10 +2322,8 @@ protected final Collection<JavadocModule> getDependencySourcePaths() throws Mave
}

/**
* Returns a ArtifactFilter that only includes direct dependencies of this project
* Returns an ArtifactFilter that only includes direct dependencies of this project
* (verified via groupId and artifactId).
*
* @return
*/
private TransformableFilter createDependencyArtifactFilter() {
Set<Artifact> dependencyArtifacts = project.getDependencyArtifacts();
Expand Down Expand Up @@ -5659,12 +5657,12 @@ protected final OfflineLink getDefaultJavadocApiLink() {
}

/**
* Follows all of the given links if the Javadoc version is before 12, and returns their last
* redirect locations. Ordering is kept. This is necessary because javadoc tool doesn't follow
* Follows the given links if the Javadoc version is before 12, and returns their last
* redirect locations. Ordering is kept. This is necessary because the javadoc tool doesn't follow
* links, see JDK-8190312 (MJAVADOC-427, MJAVADOC-487)
*
* @param links Links to follow.
* @return Last redirect location of all the links.
* @param links Links to follow=
* @return last redirect location of all the links
*/
private Set<String> followLinks(Set<String> links) {
if (javadocRuntimeVersion.isAtLeast("12")) {
Expand Down Expand Up @@ -5816,23 +5814,23 @@ private boolean isJavadocVMInitError(String output) {
// ----------------------------------------------------------------------

/**
* @param p not null
* @return the javadoc link based on the project url i.e. <code>${project.url}/apidocs</code>.
* @param project not null
* @return the javadoc link based on the project URL i.e. <code>${project.url}/apidocs</code>.
* @since 2.6
*/
private static String getJavadocLink(MavenProject p) {
if (p.getUrl() == null) {
private static String getJavadocLink(MavenProject project) {
if (project.getUrl() == null) {
return null;
}

String url = cleanUrl(p.getUrl());
String url = cleanUrl(project.getUrl());

return url + "/apidocs";
}

/**
* @param url could be null.
* @return the url cleaned or empty if url was null.
* @param url could be null
* @return the cleaned URL or empty if url was null
* @since 2.6
*/
private static String cleanUrl(String url) {
Expand All @@ -5849,40 +5847,39 @@ private static String cleanUrl(String url) {
}

/**
* @param p not null
* @param project not null
* @param pluginId not null key of the plugin defined in {@link org.apache.maven.model.Build#getPluginsAsMap()}
* or in {@link org.apache.maven.model.PluginManagement#getPluginsAsMap()}
* @return the Maven plugin defined in <code>${project.build.plugins}</code> or in
* <code>${project.build.pluginManagement}</code>, or <code>null</code> if not defined.
* <code>${project.build.pluginManagement}</code>, or <code>null</code> if not defined
* @since 2.6
*/
private static Plugin getPlugin(MavenProject p, String pluginId) {
if ((p.getBuild() == null) || (p.getBuild().getPluginsAsMap() == null)) {
private static Plugin getPlugin(MavenProject project, String pluginId) {
if ((project.getBuild() == null) || (project.getBuild().getPluginsAsMap() == null)) {
return null;
}

Plugin plugin = p.getBuild().getPluginsAsMap().get(pluginId);
Plugin plugin = project.getBuild().getPluginsAsMap().get(pluginId);

if ((plugin == null)
&& (p.getBuild().getPluginManagement() != null)
&& (p.getBuild().getPluginManagement().getPluginsAsMap() != null)) {
plugin = p.getBuild().getPluginManagement().getPluginsAsMap().get(pluginId);
&& (project.getBuild().getPluginManagement() != null)
&& (project.getBuild().getPluginManagement().getPluginsAsMap() != null)) {
plugin = project.getBuild().getPluginManagement().getPluginsAsMap().get(pluginId);
}

return plugin;
}

/**
* @param p not null
* @param project the Maven project
* @param pluginId not null
* @param param not null
* @return the simple parameter as String defined in the plugin configuration by <code>param</code> key
* @return the string parameter defined in the plugin configuration by <code>param</code> key
* or <code>null</code> if not found.
* @since 2.6
*/
private static String getPluginParameter(MavenProject p, String pluginId, String param) {
// p.getGoalConfiguration( pluginGroupId, pluginArtifactId, executionId, goalId );
Plugin plugin = getPlugin(p, pluginId);
private static String getPluginParameter(MavenProject project, String pluginId, String param) {
Plugin plugin = getPlugin(project, pluginId);
if (plugin != null) {
Xpp3Dom xpp3Dom = (Xpp3Dom) plugin.getConfiguration();
if (xpp3Dom != null
Expand Down Expand Up @@ -5952,7 +5949,8 @@ protected final JavadocOptions buildJavadocOptions() throws IOException {
/**
* Override this if you need to provide a bundle attachment classifier, as in the case of test
* javadocs.
* @return The attachment classifier.
*
* @return the attachment classifier
*/
protected String getAttachmentClassifier() {
return JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER;
Expand All @@ -5961,8 +5959,8 @@ protected String getAttachmentClassifier() {
/**
* Logs an error with throwable content only if in debug.
*
* @param message The message which should be announced.
* @param t The throwable part of the message.
* @param message the message which should be announced
* @param t the throwable part of the message
*/
protected void logError(String message, Throwable t) {
if (getLog().isDebugEnabled()) {
Expand All @@ -5977,8 +5975,8 @@ protected List<MavenProject> getReactorProjects() {
}

/**
* @param prefix The prefix of the exception.
* @param e The exception.
* @param prefix the prefix of the exception
* @param e the exception
* @throws MojoExecutionException {@link MojoExecutionException} issue while generating report
*/
protected void failOnError(String prefix, Exception e) throws MojoExecutionException {
Expand Down