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

Code cleanup #23

Merged
merged 8 commits into from
Apr 23, 2019
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
135 changes: 62 additions & 73 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,84 +1,73 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.15</version>
<!-- which version of Hudson is this plugin built against? -->
<relativePath />
</parent>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.25</version>
</parent>

<artifactId>extended-choice-parameter</artifactId>
<packaging>hpi</packaging>
<version>0.79-SNAPSHOT</version>
<name>Extended Choice Parameter Plug-In</name>
<url>http://wiki.jenkins-ci.org/display/JENKINS/Extended+Choice+Parameter+plugin</url>
<artifactId>extended-choice-parameter</artifactId>
<packaging>hpi</packaging>
<version>0.79-SNAPSHOT</version>
<name>Extended Choice Parameter Plug-In</name>
<url>https://wiki.jenkins.io/display/JENKINS/Extended+Choice+Parameter+plugin</url>

<properties>
<!--jenkins-core.version>2.127-20180610.103314-1</jenkins-core.version>
<jenkins-war.version>2.127-20180610.103343-1</jenkins-war.version-->
<jenkins.version>2.60.3</jenkins.version>
<java.level>8</java.level>
</properties>
<properties>
<!--jenkins-core.version>2.127-20180610.103314-1</jenkins-core.version>
<jenkins-war.version>2.127-20180610.103343-1</jenkins-war.version-->
<jenkins.version>2.60.3</jenkins.version>
<java.level>8</java.level>
</properties>

<developers>
<developer>
<id>vimil</id>
<name>Vimil Saju</name>
</developer>
</developers>
<developers>
<developer>
<id>vimil</id>
<name>Vimil Saju</name>
</developer>
</developers>

<dependencies>
<dependency>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>2.0</version>
</dependency>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jquery</artifactId>
<version>1.11.2-0</version>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>script-security</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>io.fastjson</groupId>
<artifactId>boon</artifactId>
<version>0.33</version>
</dependency>
</dependencies>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jquery</artifactId>
<version>1.11.2-0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>script-security</artifactId>
<version>1.19</version>
</dependency>
<dependency>
<groupId>io.fastjson</groupId>
<artifactId>boon</artifactId>
<version>0.33</version>
</dependency>
</dependencies>

<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>

<!-- get every artifact through maven.glassfish.org, which proxies all the artifacts that we need -->
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>maven.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/releases/</url>
</repository>
<snapshotRepository>
<id>maven.jenkins-ci.org</id>
<url>http://repo.jenkins-ci.org/snapshots/</url>
</snapshotRepository>
</distributionManagement>
<scm>
<connection>scm:git:ssh://[email protected]/jenkinsci/extended-choice-parameter-plugin.git</connection>
<developerConnection>scm:git:ssh://[email protected]/jenkinsci/extended-choice-parameter-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/extended-choice-parameter-plugin</url>
<tag>extended-choice-parameter-0.66</tag>
</scm>
<scm>
<connection>scm:git:ssh://[email protected]/jenkinsci/extended-choice-parameter-plugin.git</connection>
<developerConnection>scm:git:ssh://[email protected]/jenkinsci/extended-choice-parameter-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/extended-choice-parameter-plugin</url>
<tag>extended-choice-parameter-0.66</tag>
</scm>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -789,16 +789,7 @@ private synchronized GroovyShell getGroovyShell(String groovyClasspath) {
contextField.setAccessible(true);
contextField.set(groovyShell, groovyBinding);
}
catch(NoSuchFieldException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
catch(SecurityException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
catch(IllegalArgumentException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
catch(IllegalAccessException e) {
catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}

Expand Down Expand Up @@ -1027,12 +1018,12 @@ public String getMultiLevelDropdownIds() throws Exception {

/* dropdownIds is of a form like this:
return name + " dropdown MultiLevelMultiSelect 0,"
// next select the source of the genome -- each genome gets a seperate dropdown id:"
// next select the source of the genome -- each genome gets a separate dropdown id:"
+ name + " dropdown MultiLevelMultiSelect 0 HG18,dropdown MultiLevelMultiSelect 0 ZZ23,"
// next select the cell type of the source -- each source gets a seperate dropdown id
// next select the cell type of the source -- each source gets a separate dropdown id
+ name + " dropdown MultiLevelMultiSelect 0 HG18 Diffuse large B-cell lymphoma, dropdown MultiLevelMultiSelect 0 HG18 Multiple Myeloma,"
+ name + " dropdown MultiLevelMultiSelect 0 ZZ23 Neuroblastoma,"
// next select the name from the cell type -- each cell type gets a seperate dropdown id
// next select the name from the cell type -- each cell type gets a separate dropdown id
+ name + " dropdown MultiLevelMultiSelect 0 HG18 Diffuse large B-cell lymphoma LY1,"
+ name + " dropdown MultiLevelMultiSelect 0 HG18 Multiple Myeloma MM1S,"
+ name + " dropdown MultiLevelMultiSelect 0 ZZ23 Neuroblastoma BE2C,"
Expand Down Expand Up @@ -1275,10 +1266,7 @@ else if(!StringUtils.isBlank(descriptionGroovyScriptFile)) {
result = !checkScriptApproval(script, descriptionGroovyClasspath, true);
}
}
catch(IOException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
catch(URISyntaxException e) {
catch(IOException | URISyntaxException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
return result;
Expand All @@ -1302,10 +1290,7 @@ private boolean checkScriptApproval(String groovyScript, String groovyClasspath,
scriptApproval.configuring(groovyScript, GroovyLanguage.get(), ApprovalContext.create());
scriptApproval.using(groovyScript, GroovyLanguage.get());
}
catch(UnapprovedUsageException uUE) {
result = false;
}
catch(UnapprovedClasspathException uCE) {
catch(UnapprovedUsageException | UnapprovedClasspathException e) {
result = false;
}

Expand All @@ -1317,10 +1302,7 @@ private boolean checkScriptApproval(String groovyScript, String groovyClasspath,
try {
scriptApproval.using(classpathDirDigestEntry);
}
catch(UnapprovedUsageException uUE) {
result = false;
}
catch(UnapprovedClasspathException uCE) {
catch(UnapprovedUsageException | UnapprovedClasspathException e) {
result = false;
}
}
Expand All @@ -1332,10 +1314,7 @@ private boolean checkScriptApproval(String groovyScript, String groovyClasspath,
try {
scriptApproval.using(classpathEntry);
}
catch(UnapprovedUsageException uUE) {
result = false;
}
catch(UnapprovedClasspathException uCE) {
catch(UnapprovedUsageException | UnapprovedClasspathException e) {
result = false;
}
}
Expand Down Expand Up @@ -1492,10 +1471,7 @@ public Object getJSONEditorOptions() {

result = executeGroovyScript(script, bindings, groovyClasspath);
}
catch(IOException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
catch(URISyntaxException e) {
catch(IOException | URISyntaxException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
return result;
Expand All @@ -1517,10 +1493,7 @@ private String expandVariables(String input) {
}
result = Util.replaceMacro(input, envVars);
}
catch(IOException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
catch(InterruptedException e) {
catch(IOException | InterruptedException e) {
LOGGER.log(Level.SEVERE, e.getMessage(), e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public String resolve(String name) {
ParametersDefinitionProperty parametersDefinitionProperty = build.getProject().getProperty(ParametersDefinitionProperty.class);
if(parametersDefinitionProperty != null) {
ParameterDefinition parameterDefinition = parametersDefinitionProperty.getParameterDefinition(name);
if(parameterDefinition != null && parameterDefinition instanceof ExtendedChoiceParameterDefinition) {
if(parameterDefinition instanceof ExtendedChoiceParameterDefinition) {
ExtendedChoiceParameterDefinition extendedChoiceParameterDefinition = (ExtendedChoiceParameterDefinition)parameterDefinition;
if(ExtendedChoiceParameterDefinition.PARAMETER_TYPE_JSON.equals(extendedChoiceParameterDefinition.getType()) && extendedChoiceParameterDefinition.isSaveJSONParameterToFile()) {
File jsonParametersDir = new File(build.getRootDir(), "parameters");
Expand Down