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

Unify @NonNull and @Override annotation position #9948

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 4 additions & 3 deletions core/src/main/java/hudson/model/AbstractBuild.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,10 @@ public FilePath[] getModuleRoots() {
return culprits;
}

@Override
@Exported
@NonNull public Set<User> getCulprits() {
@NonNull
@Override
public Set<User> getCulprits() {
return RunWithSCM.super.getCulprits();
}

Expand All @@ -348,8 +349,8 @@ public boolean shouldCalculateCulprits() {
return getCulpritIds() == null;
}

@Override
@NonNull
@Override
public Set<User> calculateCulprits() {
Set<User> c = RunWithSCM.super.calculateCulprits();

Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/model/Computer.java
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,8 @@ public String getCaption() {
return Messages.Computer_Caption(nodeName);
}

@Override
@NonNull
@Override
public String getUrl() {
return "computer/" + Util.fullEncode(getName()) + "/";
}
Expand Down Expand Up @@ -966,8 +966,8 @@ public List<Executor> getAllExecutors() {
* {@inheritDoc}
* @since 1.607
*/
@Override
@NonNull
@Override
public List<IDisplayExecutor> getDisplayExecutors() {
// The size may change while we are populating, but let's start with a reasonable guess to minimize resizing
List<IDisplayExecutor> result = new ArrayList<>(executors.size() + oneOffExecutors.size());
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/JobProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ public final Action getProjectAction(AbstractProject<?, ?> project) {
return getJobAction((J) project);
}

@Override
@NonNull
@Override
public final Collection<? extends Action> getProjectActions(AbstractProject<?, ?> project) {
return getJobActions((J) project);
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Label.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ public final String getName() {
/**
* Returns a human-readable text that represents this label.
*/
@Override
@NonNull
@Override
public String getDisplayName() {
return name;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/ParameterDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ public String getFormattedDescription() {
}
}

@Override
@NonNull
@Override
public ParameterDescriptor getDescriptor() {
return (ParameterDescriptor) Jenkins.get().getDescriptorOrDie(getClass());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ public ParameterDefinition getParameterDefinition(String name) {
return null;
}

@Extension
@Symbol("parameters")
@Extension @Symbol("parameters")
public static class DescriptorImpl extends OptionalJobPropertyDescriptor {
@Override
public ParametersDefinitionProperty newInstance(StaplerRequest2 req, JSONObject formData) throws FormException {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Queue.java
Original file line number Diff line number Diff line change
Expand Up @@ -2173,8 +2173,8 @@ public int getIdLegacy() {

private final long inQueueSince;

@Override
@NonNull
@Override
public Task getTask() {
return task;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Slave.java
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ public byte[] readFully() throws IOException {
* If there is no computer it will return a {@link hudson.Launcher.DummyLauncher}, otherwise it
* will return a {@link hudson.Launcher.RemoteLauncher} instead.
*/
@Override
@NonNull
@Override
public Launcher createLauncher(TaskListener listener) {
SlaveComputer c = getComputer();
if (c == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ public StringParameterValue getDefaultParameterValue() {

@Extension @Symbol({"string", "stringParam"})
public static class DescriptorImpl extends ParameterDescriptor {
@Override
@NonNull
@Override
public String getDisplayName() {
return Messages.StringParameterDefinition_DisplayName();
}
Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/hudson/model/TimeZoneProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ public String getTimeZoneName() {
return timeZoneName;
}

@Extension
@Symbol("timezone")
@Extension @Symbol("timezone")
public static class DescriptorImpl extends UserPropertyDescriptor {

@NonNull
Expand Down
5 changes: 2 additions & 3 deletions core/src/main/java/hudson/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -918,8 +918,8 @@ public void doRssLatest(StaplerRequest2 req, StaplerResponse2 rsp) throws IOExce
RSS.rss(req, rsp, "Jenkins:" + getDisplayName() + " (latest builds)", getUrl(), RunList.fromRuns(lastBuilds), Run.FEED_ADAPTER_LATEST);
}

@Override
@NonNull
@Override
public ACL getACL() {
ACL base = Jenkins.get().getAuthorizationStrategy().getACL(this);
// always allow a non-anonymous user full control of himself.
Expand Down Expand Up @@ -1193,8 +1193,7 @@ public static String resolve(@NonNull String idOrFullName, @NonNull Map<String,
/**
* Resolve user ID from full name
*/
@Extension
@Symbol("fullName")
@Extension @Symbol("fullName")
public static class FullNameIdResolver extends CanonicalIdResolver {

@Override
Expand Down
Loading