Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gboissinot committed Jan 27, 2013
1 parent 3e37216 commit 8657912
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci</groupId>
<artifactId>jenkins</artifactId>
<version>1.19</version>
<version>1.29</version>
</parent>

<groupId>org.jenkins-ci.lib</groupId>
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/org/jenkinsci/lib/envinject/EnvInjectAction.java
@@ -1,6 +1,7 @@
package org.jenkinsci.lib.envinject;

import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Action;
import org.apache.commons.collections.map.UnmodifiableMap;
import org.jenkinsci.lib.envinject.service.EnvInjectSavable;
Expand Down Expand Up @@ -36,7 +37,7 @@ public void overrideAll(Map<String, String> all) {
envMap.putAll(all);
}

@SuppressWarnings("unused")
@SuppressWarnings({"unused", "unchecked"})
public Map<String, String> getEnvMap() {
return UnmodifiableMap.decorate(envMap);
}
Expand All @@ -46,7 +47,7 @@ public String getIconFileName() {
}

public String getDisplayName() {
return "Injected Environment Variables";
return "Environment Variables";
}

public String getUrlName() {
Expand Down Expand Up @@ -83,7 +84,11 @@ private Object readResolve() throws ObjectStreamException {
Map<String, String> resultMap = null;
try {
if (build != null) {
resultMap = dao.getEnvironment(build.getRootDir());
AbstractProject project = build.getProject();
if (project != null) {
File rootDir = new File(project.getRootDir(), build.getId());
resultMap = dao.getEnvironment(rootDir);
}
} else if (rootDir != null) {
resultMap = dao.getEnvironment(rootDir);
}
Expand Down

0 comments on commit 8657912

Please sign in to comment.