Skip to content
Permalink
Browse files

[JENKINS-43507] More javadoc documentation (and more compliance too)

  • Loading branch information...
stephenc committed May 2, 2017
1 parent c5c4116 commit 72cab2ad2ea1e48b9de2b71283990836a3638b2f
Showing with 978 additions and 28 deletions.
  1. +21 −0 src/main/java/hudson/plugins/git/extensions/impl/AuthorInChangelog.java
  2. +26 −0 src/main/java/hudson/plugins/git/extensions/impl/CheckoutOption.java
  3. +47 −0 src/main/java/hudson/plugins/git/extensions/impl/CloneOption.java
  4. +21 −0 src/main/java/hudson/plugins/git/extensions/impl/GitLFSPull.java
  5. +1 −1 src/main/java/hudson/plugins/git/extensions/impl/LocalBranch.java
  6. +21 −0 src/main/java/hudson/plugins/git/extensions/impl/PruneStaleBranch.java
  7. +46 −0 src/main/java/hudson/plugins/git/extensions/impl/SubmoduleOption.java
  8. +30 −0 src/main/java/hudson/plugins/git/extensions/impl/UserIdentity.java
  9. +21 −0 src/main/java/hudson/plugins/git/extensions/impl/WipeWorkspace.java
  10. +3 −3 src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
  11. +1 −1 src/main/java/jenkins/plugins/git/GitSCMSource.java
  12. +2 −1 src/main/java/jenkins/plugins/git/GitSCMSourceContext.java
  13. +40 −6 src/main/java/jenkins/plugins/git/GitSCMSourceRequest.java
  14. +31 −0 src/main/java/jenkins/plugins/git/traits/AuthorInChangelogTrait.java
  15. +31 −0 src/main/java/jenkins/plugins/git/traits/CheckoutOptionTrait.java
  16. +31 −0 src/main/java/jenkins/plugins/git/traits/CleanAfterCheckoutTrait.java
  17. +31 −0 src/main/java/jenkins/plugins/git/traits/CleanBeforeCheckoutTrait.java
  18. +31 −0 src/main/java/jenkins/plugins/git/traits/CloneOptionTrait.java
  19. +47 −1 src/main/java/jenkins/plugins/git/traits/GitBrowserSCMSourceTrait.java
  20. +31 −0 src/main/java/jenkins/plugins/git/traits/GitLFSPullTrait.java
  21. +28 −0 src/main/java/jenkins/plugins/git/traits/GitSCMExtensionTrait.java
  22. +41 −1 src/main/java/jenkins/plugins/git/traits/GitSCMExtensionTraitDescriptor.java
  23. +50 −4 src/main/java/jenkins/plugins/git/traits/GitToolSCMSourceTrait.java
  24. +50 −1 src/main/java/jenkins/plugins/git/traits/IgnoreOnPushNotificationTrait.java
  25. +34 −1 src/main/java/jenkins/plugins/git/traits/LocalBranchTrait.java
  26. +33 −2 src/main/java/jenkins/plugins/git/traits/PruneStaleBranchTrait.java
  27. +43 −3 src/main/java/jenkins/plugins/git/traits/RefSpecsSCMSourceTrait.java
  28. +47 −1 src/main/java/jenkins/plugins/git/traits/RemoteNameSCMSourceTrait.java
  29. +31 −0 src/main/java/jenkins/plugins/git/traits/SubmoduleOptionTrait.java
  30. +31 −0 src/main/java/jenkins/plugins/git/traits/UserIdentityTrait.java
  31. +33 −2 src/main/java/jenkins/plugins/git/traits/WipeWorkspaceTrait.java
  32. +44 −0 src/main/java/jenkins/plugins/git/traits/package-info.java
@@ -22,6 +22,27 @@ public boolean requiresWorkspaceForPolling() {
return true;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return o instanceof AuthorInChangelog;
}

@Override
public int hashCode() {
return AuthorInChangelog.class.hashCode();
}

@Override
public String toString() {
return "AuthorInChangelog{}";
}

@Extension
public static class DescriptorImpl extends GitSCMExtensionDescriptor {
@Override
@@ -48,6 +48,32 @@ public void decorateCheckoutCommand(GitSCM scm, AbstractBuild<?, ?> build, GitCl
cmd.timeout(timeout);
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

CheckoutOption that = (CheckoutOption) o;

return timeout != null ? timeout.equals(that.timeout) : that.timeout == null;
}

@Override
public int hashCode() {
return 0;
}

@Override
public String toString() {
return "CheckoutOption{" +
"timeout=" + timeout +
'}';
}

@Extension
public static class DescriptorImpl extends GitSCMExtensionDescriptor {

@@ -162,6 +162,53 @@ public GitClientType getRequiredClient() {
return GitClientType.GITCLI;
}


@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

CloneOption that = (CloneOption) o;

if (shallow != that.shallow) {
return false;
}
if (noTags != that.noTags) {
return false;
}
if (depth != that.depth) {
return false;
}
if (honorRefspec != that.honorRefspec) {
return false;
}
if (reference != null ? !reference.equals(that.reference) : that.reference != null) {
return false;
}
return timeout != null ? timeout.equals(that.timeout) : that.timeout == null;
}

@Override
public int hashCode() {
return CloneOption.class.hashCode();
}

@Override
public String toString() {
return "CloneOption{" +
"shallow=" + shallow +
", noTags=" + noTags +
", reference='" + reference + '\'' +
", timeout=" + timeout +
", depth=" + depth +
", honorRefspec=" + honorRefspec +
'}';
}

@Extension
public static class DescriptorImpl extends GitSCMExtensionDescriptor {
@Override
@@ -43,6 +43,27 @@ public void decorateCheckoutCommand(GitSCM scm, Run<?, ?> build, GitClient git,
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return o instanceof GitLFSPull;
}

@Override
public int hashCode() {
return GitLFSPull.class.hashCode();
}

@Override
public String toString() {
return "GitLFSPull{}";
}

@Extension
public static class DescriptorImpl extends GitSCMExtensionDescriptor {
@Override
@@ -46,7 +46,7 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return localBranch != null ? localBranch.hashCode() : 0;
return LocalBranch.class.hashCode();
}

@Override
@@ -29,6 +29,27 @@ public void decorateFetchCommand(GitSCM scm, GitClient git, TaskListener listene
cmd.prune();
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return o instanceof PruneStaleBranch;
}

@Override
public int hashCode() {
return PruneStaleBranch.class.hashCode();
}

@Override
public String toString() {
return "PruneStaleBranch{}";
}

@Extension
public static class DescriptorImpl extends GitSCMExtensionDescriptor {
@Override
@@ -119,6 +119,52 @@ public void onCheckoutCompleted(GitSCM scm, Run<?, ?> build, GitClient git, Task
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

SubmoduleOption that = (SubmoduleOption) o;

if (disableSubmodules != that.disableSubmodules) {
return false;
}
if (recursiveSubmodules != that.recursiveSubmodules) {
return false;
}
if (trackingSubmodules != that.trackingSubmodules) {
return false;
}
if (parentCredentials != that.parentCredentials) {
return false;
}
if (reference != null ? !reference.equals(that.reference) : that.reference != null) {
return false;
}
return timeout != null ? timeout.equals(that.timeout) : that.timeout == null;
}

@Override
public int hashCode() {
return SubmoduleOption.class.hashCode();
}

@Override
public String toString() {
return "SubmoduleOption{" +
"disableSubmodules=" + disableSubmodules +
", recursiveSubmodules=" + recursiveSubmodules +
", trackingSubmodules=" + trackingSubmodules +
", reference='" + reference + '\'' +
", parentCredentials=" + parentCredentials +
", timeout=" + timeout +
'}';
}

@Extension
public static class DescriptorImpl extends GitSCMExtensionDescriptor {
@Override
@@ -50,6 +50,36 @@ public void populateEnvironmentVariables(GitSCM scm, Map<String, String> env) {
}
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

UserIdentity that = (UserIdentity) o;

if (name != null ? !name.equals(that.name) : that.name != null) {
return false;
}
return email != null ? email.equals(that.email) : that.email == null;
}

@Override
public int hashCode() {
return UserIdentity.class.hashCode();
}

@Override
public String toString() {
return "UserIdentity{" +
"name='" + name + '\'' +
", email='" + email + '\'' +
'}';
}

@Override
public GitClient decorate(GitSCM scm, GitClient git) throws IOException, InterruptedException, GitException {
GitSCM.DescriptorImpl d = scm.getDescriptor();
@@ -28,6 +28,27 @@ public void beforeCheckout(GitSCM scm, Run<?, ?> build, GitClient git, TaskListe
git.getWorkTree().deleteContents();
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return o instanceof WipeWorkspace;
}

@Override
public int hashCode() {
return WipeWorkspace.class.hashCode();
}

@Override
public String toString() {
return "WipeWorkspace{}";
}

@Extension
public static class DescriptorImpl extends GitSCMExtensionDescriptor {
@Override
@@ -348,15 +348,15 @@ public Void run(GitClient client, String remoteName) throws IOException, Interru
count++;
final String branchName = StringUtils.removeStart(b.getName(), remoteName + "/");
if (request.process(new SCMHead(branchName),
new SCMSourceRequest.IntermediateFactory<ObjectId>() {
new SCMSourceRequest.IntermediateLambda<ObjectId>() {
@Nullable
@Override
public ObjectId create() throws IOException, InterruptedException {
listener.getLogger().println(" Checking branch " + branchName);
return b.getSHA1();
}
},
new SCMSourceRequest.ProbeFactory<SCMHead, ObjectId>() {
new SCMSourceRequest.ProbeLambda<SCMHead, ObjectId>() {
@NonNull
@Override
public SCMSourceCriteria.Probe create(@NonNull SCMHead head,
@@ -413,7 +413,7 @@ public SCMProbeStat stat(@NonNull String path) throws IOException {
}
};
}
}, new SCMSourceRequest.LazyRevisionFactory<SCMHead, SCMRevision, ObjectId>() {
}, new SCMSourceRequest.LazyRevisionLambda<SCMHead, SCMRevision, ObjectId>() {
@NonNull
@Override
public SCMRevision create(@NonNull SCMHead head, @Nullable ObjectId intermediate)
@@ -141,7 +141,7 @@
*
* @since 3.4.0
*/
private List<SCMSourceTrait> traits;
private List<SCMSourceTrait> traits = new ArrayList<>();

@DataBoundConstructor
public GitSCMSource(String id, String remote, String credentialsId) {
@@ -170,7 +170,8 @@ public final C withRefSpec(@NonNull String refSpec) {
/**
* Adds the specified ref specs. If no ref specs were previously defined then the supplied ref specs will replace
* {@link AbstractGitSCMSource#REF_SPEC_DEFAULT}. The ref spec is expected to be processed for substitution of
* {@link AbstractGitSCMSource#REF_SPEC_REMOTE_NAME_PLACEHOLDER_STR} by {@link #remote()} before use.
* {@link AbstractGitSCMSource#REF_SPEC_REMOTE_NAME_PLACEHOLDER_STR} by {@link AbstractGitSCMSource#getRemote()}
* before use.
*
* @param refSpecs the ref spec templates to add.
* @return {@code this} for method chaining.
Oops, something went wrong.

0 comments on commit 72cab2a

Please sign in to comment.
You can’t perform that action at this time.