Skip to content

Commit

Permalink
Reword and improve Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
cstamas committed Oct 15, 2023
1 parent a2c9569 commit 85e2703
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,19 @@ public String getUpdatePolicy() {
/**
* Sets the global update policy. If set, the global update policy overrides the update policies of the remote
* repositories being used for resolution.
* <p>
* This method is meant for code that does not want to distinguish between artifact and metadata policies.
* Note: applications should either use get/set updatePolicy (this method and
* {@link RepositorySystemSession#getUpdatePolicy()}) or also distinguish between artifact and
* metadata update policies (and use other methods), but <em>should not mix the two!</em>
*
* @param updatePolicy The global update policy, may be {@code null}/empty to apply the per-repository policies.
* @return This session for chaining, never {@code null}.
* @see RepositoryPolicy#UPDATE_POLICY_ALWAYS
* @see RepositoryPolicy#UPDATE_POLICY_DAILY
* @see RepositoryPolicy#UPDATE_POLICY_NEVER
* @see #setArtifactUpdatePolicy(String)
* @see #setMetadataUpdatePolicy(String)
*/
public DefaultRepositorySystemSession setUpdatePolicy(String updatePolicy) {
verifyStateForMutation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,15 @@ public interface RepositorySystemSession {
String getChecksumPolicy();

/**
* Method for code that does not want to distinguish between artifact and metadata policies, in reality this
* is method invokes {@link #getArtifactUpdatePolicy()}.
* Gets the global update policy, or {@code null} if not set.
* <p>
* This method is meant for code that does not want to distinguish between artifact and metadata policies.
* Note: applications should either use get/set updatePolicy (this method and
* {@link DefaultRepositorySystemSession#setUpdatePolicy(String)}) or also distinguish between artifact and
* metadata update policies (and use other methods), but <em>should not mix the two!</em>
*
* @see #getArtifactUpdatePolicy()
* @see #getMetadataUpdatePolicy()
*/
String getUpdatePolicy();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,14 @@ public boolean isEnabled() {
}

/**
* Shorthand for {@link #getArtifactUpdatePolicy()}. This method is not used in Resolver, nor should be
* used outside it. Internally, resolver strictly distinguishes between artifact and metadata update
* policies.
* This method is not used in Resolver, as resolver internally strictly distinguishes between artifact and metadata
* update policies.
*
* @deprecated Use {@link #getArtifactUpdatePolicy()} or {@link #getMetadataUpdatePolicy()} instead.
* @see #getArtifactUpdatePolicy()
* @see #getMetadataUpdatePolicy()
* @deprecated This method should not be used. Since version 2 Resolver internally distinguishes between artifact
* update policy and metadata update policy. This method was left only to preserve binary compatibility, and in
* reality invokes {@link #getArtifactUpdatePolicy()}.
*/
@Deprecated
public String getUpdatePolicy() {
Expand Down

0 comments on commit 85e2703

Please sign in to comment.