Skip to content
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

[docs] Fix some javadoc issues #690

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
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 @@ -129,7 +129,6 @@ public static GitLookup create(File file, Map<String, String> props) {
* otherwise must be {@code null}.
* @param checkCommitsCount the number of historical commits, per file, to check
* @param commitsToIgnore the commits to ignore while inspecting the history for {@code anyFile}
* @throws IOException
*/
private GitLookup(File anyFile, DateSource dateSource, TimeZone timeZone, int checkCommitsCount, Set<ObjectId> commitsToIgnore) {
requireNonNull(anyFile);
Expand Down Expand Up @@ -192,8 +191,8 @@ int getYearOfLastChange(File file) throws GitAPIException, IOException {
return commitYear;
}

/*
* Returns the year of creation for the given {@code file) based on the history of the present git branch. The
/**
* Returns the year of creation for the given {@code file} based on the history of the present git branch. The
* year is taken either from the committer date or from the author identity depending on how {@link #dateSource} was
* initialized.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
*/
public class GitPathResolver {

/**
* The path separator expected by jGit.
*/
/** The path separator expected by jGit. */
private static final char CANONICAL_PATH_SEPARATOR = '/';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public abstract class AbstractLicenseMojo extends AbstractMojo {

/**
* HeadSections define special regions of a header that allow for dynamic
* substitution and validation
* substitution and validation.
*
* @deprecated use {@link LicenseSet#headerSections}
*/
Expand Down Expand Up @@ -295,9 +295,7 @@ public abstract class AbstractLicenseMojo extends AbstractMojo {
@Parameter(property = "license.nThreads", defaultValue = "0")
public int nThreads;

/**
* Whether to skip the plugin execution
*/
/** Whether to skip the plugin execution. */
@Parameter(property = "license.skip", defaultValue = "false")
public boolean skip;

Expand All @@ -311,10 +309,7 @@ public abstract class AbstractLicenseMojo extends AbstractMojo {
@Parameter(property = "license.warnIfShallow", defaultValue = "true")
public boolean warnIfShallow = true;

/**
* If you do not want to see the list of file having a missing header, you
* can add the quiet flag that will shorten the output
*/
/** If you do not want to see the list of file having a missing header, you can add the quiet flag that will shorten the output. */
@Parameter(property = "license.quiet", defaultValue = "false")
public boolean quiet;

Expand Down Expand Up @@ -906,7 +901,7 @@ List<Server> getDecryptedServers() {

/**
* Retrieves the credentials for the given server or null if none could be
* found
* found.
*
* @param serverID
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@

public class HeaderStyle {

/**
* The name of this header style
*/
/** The name of this header style. */
@Parameter(required = true)
public String name;

Expand Down Expand Up @@ -85,15 +83,11 @@ public class HeaderStyle {
@Parameter
public String skipLinePattern;

/**
* The regex used to detect the start of a header section or line
*/
/** The regex used to detect the start of a header section or line. */
@Parameter(required = true)
public String firstLineDetectionPattern;

/**
* The regex used to detect the end of a header section or line
*/
/** The regex used to detect the end of a header section or line. */
@Parameter(required = true)
public String lastLineDetectionPattern;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.util.stream.Collectors;

/**
* Check if the source files of the project have a valid license header
* Check if the source files of the project have a valid license header.
*/
@Mojo(name = "check", defaultPhase = LifecyclePhase.VERIFY, threadSafe = true)
public final class LicenseCheckMojo extends AbstractLicenseMojo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.io.File;

/**
* Reformat files with a missing header to add it
* Reformat files with a missing header to add it.
*/
@Mojo(name = "format", threadSafe = true)
public final class LicenseFormatMojo extends AbstractLicenseMojo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.io.File;

/**
* Remove the specified header from source files
* Remove the specified header from source files.
*/
@Mojo(name = "remove", threadSafe = true)
public final class LicenseRemoveMojo extends AbstractLicenseMojo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,7 @@ public class LicenseSet {
@Parameter
public HeaderStyle[] inlineHeaderStyles = new HeaderStyle[0];

/**
* HeadSections define special regions of a header that allow for dynamic
* substitution and validation
*/
/** HeadSections define special regions of a header that allow for dynamic substitution and validation. */
@Parameter
public HeaderSection[] headerSections = new HeaderSection[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ default Map<String, String> adjustProperties(AbstractLicenseMojo mojo,
}

/**
* Gets the additional properties.
*
* @param mojo the maven mojo
* @param currentProperties the current properties
* @param document the document to process
* @return the additional properties
*
* @deprecated Use instead {@link #adjustProperties(AbstractLicenseMojo, Map, Document)}
*/
@Deprecated
Expand All @@ -47,5 +54,6 @@ default Map<String, String> getAdditionalProperties(AbstractLicenseMojo mojo,

@Override
default void close() {
// Do nothing on default
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* Base class for all policy enforcer implementations.
*
* @param <T>
* @param <T> the generic license policy enforcer
*/
public abstract class AbstractLicensePolicyEnforcer<T> implements LicensePolicyEnforcer<T> {
private final LicensePolicy policy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
* <p>
* Rules are applied in the following order:
* 1) defaultPolicy: unless overridden via setDefaultPolicy, this will DENY all artifacts.
* 2) APPROVE policies: any policy in the Set which have {@link LicensePolicy.Rule.APPROVE}
* 3) DENY policies: any policy in the Set which have {@link LIcensePolicy.Rule.DENY}
* 2) APPROVE policies: any policy in the Set which have {@link LicensePolicy.Rule#APPROVE}
* 3) DENY policies: any policy in the Set which have {@link LicensePolicy.Rule#DENY}
*/
@SuppressWarnings("rawtypes")
public class AggregateLicensePolicyEnforcer {
Expand Down Expand Up @@ -149,6 +149,7 @@ public Map<Artifact, LicensePolicyEnforcerResult> apply(final Map<License, Set<A
* applying the internal set of {@link LicensePolicyEnforcer} implementations on them,
* and returning a mapping of Artifact keys to the boolean enforcement decision made.
*
* @param licenseMap the license map
* @return final policy decision map on each artifact
*/
public Map<Artifact, LicensePolicyEnforcerResult> apply(final LicenseMap licenseMap) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public enum Rule {
/**
* Get a boolean form of a rule.
*
* @return
* @return the predicate
*/
public boolean getPredicate() {
return allowed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ public class MavenProjectLicenses implements LicenseMap, LicenseMessage {

/**
* @param session the current {@link MavenSession}
* @param project the project {@link MavenProject}
* @param graph the {@link DependencyGraphBuilder} implementation
* @param projectBuilder the maven {@link ProjectBuilder} implementation
* @param scopes the maven scopes
* @param log the maven logger
*/
public MavenProjectLicenses(final MavenSession session, MavenProject project, final DependencyGraphBuilder graph,
final ProjectBuilder projectBuilder, final List<String> scopes, final Log log) {
Expand All @@ -85,6 +88,9 @@ public MavenProjectLicenses(final MavenSession session, MavenProject project, fi

/**
* Return a set of licenses attributed to a single artifact.
*
* @param artifact the artifact that contains the licenses
* @return the licenses from artifact
*/
protected Set<License> getLicensesFromArtifact(final Artifact artifact) {
Set<License> licenses = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public final class HeaderDefinition {
* if it can be outputted from the line of the file.
* @param firstLineDetectionPattern The pattern to detect the first line of a previous header.
* @param lastLineDetectionPattern The pattern to detect the last line of a previous header.
* @param allowBlankLines The allow blank lines flag.
* @param multiLine The multi line flag.
* @param padLines The pad lines flag.
* @throws IllegalArgumentException If the type name is null.
*/
public HeaderDefinition(String type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public final class HeaderParser {
*
* @param fileContent The file content.
* @param headerDefinition The associated header definition to use.
* @param keywords The keywords used for finding header.
* @throws IllegalArgumentException If the file content is null or if the header definition is null.
*/
public HeaderParser(FileContent fileContent, HeaderDefinition headerDefinition, String[] keywords) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
import java.util.List;

/**
* <b>Date:</b> 26-Feb-2008<br>
* <b>Author:</b> Mathieu Carbou (mathieu.carbou@gmail.com)
* The Class ResourceFinder.
*/
public final class ResourceFinder {
private final Path basedir;
Expand Down