Skip to content
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
4 changes: 4 additions & 0 deletions src/main/java/jenkins/scm/api/SCMHeadOrigin.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import edu.umd.cs.findbugs.annotations.NonNull;
import java.io.ObjectStreamException;
import java.io.Serializable;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

/**
* Represents the origin of a {@link SCMHead}.
Expand All @@ -43,6 +45,7 @@
*
* @since 2.2.0
*/
@ExportedBean
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that #35 exported SCMHead.origin yet neglected to add this annotation, causing

org.kohsuke.stapler.export.NotExportableException: class jenkins.scm.api.SCMHeadOrigin$Fork doesn't have @ExportedBean

public abstract class SCMHeadOrigin implements Serializable {

/**
Expand Down Expand Up @@ -173,6 +176,7 @@ public Fork(@NonNull String name) {
*
* @return the name of this fork.
*/
@Exported
@NonNull
public String getName() {
return name;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/jenkins/scm/api/SCMRevision.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
import edu.umd.cs.findbugs.annotations.NonNull;

import java.io.Serializable;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

/**
* Base class that represents a specific (or not so specific) revision of a {@link SCMHead}.
*
* @author Stephen Connolly
*/
@ExportedBean
public abstract class SCMRevision implements Serializable {

/**
Expand Down Expand Up @@ -78,6 +81,7 @@ public String toString() {
*
* @return {@code true} if and only if this revision is deterministic.
*/
@Exported
public boolean isDeterministic() {
return true;
}
Expand All @@ -87,6 +91,7 @@ public boolean isDeterministic() {
*
* @return the {@link SCMHead} that this {@link SCMRevision} belongs to.
*/
@Exported
@NonNull
public final SCMHead getHead() {
return head;
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/jenkins/scm/api/SCMRevisionAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
import hudson.model.InvisibleAction;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

/**
* {@link Action} added to {@link AbstractBuild} to remember
* which revision is built in the given build.
*/
@ExportedBean
public class SCMRevisionAction extends InvisibleAction {
/**
* The {@link SCMSource#getId()} or {@code null} for legacy instances.
Expand Down Expand Up @@ -91,6 +94,7 @@ public SCMRevisionAction(@NonNull SCMSource source, @NonNull SCMRevision revisio
*
* @return the {@link SCMRevision}.
*/
@Exported
@NonNull
public SCMRevision getRevision() {
return revision;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public final SCMRevision getTarget() {
* revision {@code false} if the effective revision ignores the {@link #getTarget()}.
* @see ChangeRequestSCMHead2
*/
@Exported
public final boolean isMerge() {
SCMHead head = getHead();
return !(head instanceof ChangeRequestSCMHead2)
Expand Down