Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
2eb43ff9
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2eb43ff9
编写于
5月 14, 2014
作者:
J
Jesse Glick
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adding some nullness annotations related to Job.getEnvironment.
Cf.:
https://github.com/jenkinsci/subversion-plugin/pull/83
上级
7c620e9f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
12 deletion
+17
-12
core/src/main/java/hudson/model/Computer.java
core/src/main/java/hudson/model/Computer.java
+1
-1
core/src/main/java/hudson/model/EnvironmentContributor.java
core/src/main/java/hudson/model/EnvironmentContributor.java
+8
-7
core/src/main/java/hudson/model/Job.java
core/src/main/java/hudson/model/Job.java
+3
-1
core/src/main/java/hudson/model/Run.java
core/src/main/java/hudson/model/Run.java
+2
-2
core/src/main/java/hudson/slaves/NodeProperty.java
core/src/main/java/hudson/slaves/NodeProperty.java
+3
-1
未找到文件。
core/src/main/java/hudson/model/Computer.java
浏览文件 @
2eb43ff9
...
...
@@ -918,7 +918,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
* @see ProcStarter#envs(Map)
* @since 1.489
*/
public
EnvVars
buildEnvironment
(
TaskListener
listener
)
throws
IOException
,
InterruptedException
{
public
@Nonnull
EnvVars
buildEnvironment
(
@Nonnull
TaskListener
listener
)
throws
IOException
,
InterruptedException
{
EnvVars
env
=
new
EnvVars
();
Node
node
=
getNode
();
...
...
core/src/main/java/hudson/model/EnvironmentContributor.java
浏览文件 @
2eb43ff9
...
...
@@ -31,6 +31,7 @@ import hudson.scm.SCM;
import
jenkins.model.Jenkins
;
import
java.io.IOException
;
import
javax.annotation.Nonnull
;
/**
* Contributes environment variables to builds.
...
...
@@ -79,14 +80,14 @@ public abstract class EnvironmentContributor implements ExtensionPoint {
* variables that are scoped to builds.
*
* @param r
* Build that's being performed.
Never null.
* Build that's being performed.
* @param envs
* Partially built environment variable map. Implementation of this method is expected to
* add additional variables here.
Never null.
* add additional variables here.
* @param listener
* Connected to the build console. Can be used to report errors.
Never null.
* Connected to the build console. Can be used to report errors.
*/
public
void
buildEnvironmentFor
(
Run
r
,
EnvVars
envs
,
TaskListener
listener
)
throws
IOException
,
InterruptedException
{}
public
void
buildEnvironmentFor
(
@Nonnull
Run
r
,
@Nonnull
EnvVars
envs
,
@Nonnull
TaskListener
listener
)
throws
IOException
,
InterruptedException
{}
/**
* Contributes environment variables used for a job.
...
...
@@ -103,12 +104,12 @@ public abstract class EnvironmentContributor implements ExtensionPoint {
* Job for which some activities are launched.
* @param envs
* Partially built environment variable map. Implementation of this method is expected to
* add additional variables here.
Never null.
* add additional variables here.
* @param listener
* Connected to the build console. Can be used to report errors.
Never null.
* Connected to the build console. Can be used to report errors.
* @since 1.527
*/
public
void
buildEnvironmentFor
(
Job
j
,
EnvVars
envs
,
TaskListener
listener
)
throws
IOException
,
InterruptedException
{}
public
void
buildEnvironmentFor
(
@Nonnull
Job
j
,
@Nonnull
EnvVars
envs
,
@Nonnull
TaskListener
listener
)
throws
IOException
,
InterruptedException
{}
/**
* Returns all the registered {@link EnvironmentContributor}s.
...
...
core/src/main/java/hudson/model/Job.java
浏览文件 @
2eb43ff9
...
...
@@ -96,6 +96,8 @@ import java.io.*;
import
java.net.URLEncoder
;
import
java.util.*
;
import
java.util.List
;
import
javax.annotation.CheckForNull
;
import
javax.annotation.Nonnull
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.*;
import
jenkins.model.lazy.LazyBuildMixIn
;
...
...
@@ -356,7 +358,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
* Node to eventually run a process on. The implementation must cope with this parameter being null
* (in which case none of the node specific properties would be reflected in the resulting override.)
*/
public
EnvVars
getEnvironment
(
Node
node
,
TaskListener
listener
)
throws
IOException
,
InterruptedException
{
public
@Nonnull
EnvVars
getEnvironment
(
@CheckForNull
Node
node
,
@Nonnull
TaskListener
listener
)
throws
IOException
,
InterruptedException
{
EnvVars
env
;
if
(
node
!=
null
)
{
...
...
core/src/main/java/hudson/model/Run.java
浏览文件 @
2eb43ff9
...
...
@@ -2206,10 +2206,10 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
* Unlike earlier {@link #getEnvVars()}, this map contains the whole environment,
* not just the overrides, so one can introspect values to change its behavior.
*
* @return the map with the environmental variables.
Never <code>null</code>.
* @return the map with the environmental variables.
* @since 1.305
*/
public
EnvVars
getEnvironment
(
TaskListener
listener
)
throws
IOException
,
InterruptedException
{
public
@Nonnull
EnvVars
getEnvironment
(
@Nonnull
TaskListener
listener
)
throws
IOException
,
InterruptedException
{
Computer
c
=
Computer
.
currentComputer
();
Node
n
=
c
==
null
?
null
:
c
.
getNode
();
...
...
core/src/main/java/hudson/slaves/NodeProperty.java
浏览文件 @
2eb43ff9
...
...
@@ -39,6 +39,7 @@ import hudson.model.BuildListener;
import
hudson.model.Environment
;
import
jenkins.model.Jenkins
;
import
hudson.model.Node
;
import
hudson.model.Queue
;
import
hudson.model.Queue.Task
;
import
net.sf.json.JSONObject
;
import
org.kohsuke.stapler.StaplerRequest
;
...
...
@@ -47,6 +48,7 @@ import java.io.File;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.Map
;
import
javax.annotation.Nonnull
;
/**
* Extensible property of {@link Node}.
...
...
@@ -161,7 +163,7 @@ public abstract class NodeProperty<N extends Node> implements ReconfigurableDesc
*
* @since 1.489
*/
public
void
buildEnvVars
(
EnvVars
env
,
TaskListener
listener
)
throws
IOException
,
InterruptedException
{
public
void
buildEnvVars
(
@Nonnull
EnvVars
env
,
@Nonnull
TaskListener
listener
)
throws
IOException
,
InterruptedException
{
// default is no-op
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录