diff --git a/.travis.yml b/.travis.yml index 40d3995c..6c57468f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ after_script: # http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.html # - oraclejdk8 is not supported anymore. jdk: - - openjdk7 + - openjdk8 cache: directories: - $HOME/.m2/repository diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Build.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Build.java index 14b98369..f48e38e8 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Build.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/model/Build.java @@ -140,13 +140,13 @@ public String Stop() throws HttpResponseException, IOException { try { return client.get(url + "stop"); - } catch (IOException ex) { - if (((HttpResponseException) ex).getStatusCode() == 405) { + } catch (HttpResponseException ex) { + if (ex.getStatusCode() == 405) { stopPost(); return ""; } + throw ex; } - return ""; } /** Stops the build which is currently in progress. This version takes in @@ -163,13 +163,13 @@ public String Stop(boolean crumbFlag) throws HttpResponseException, IOException try { return client.get(url + "stop"); - } catch (IOException ex) { - if (((HttpResponseException) ex).getStatusCode() == 405) { + } catch (HttpResponseException ex) { + if (ex.getStatusCode() == 405) { stopPost(crumbFlag); return ""; } + throw ex; } - return ""; } private void stopPost(boolean crumbFlag) throws HttpResponseException, IOException { diff --git a/pom.xml b/pom.xml index ff44c7e4..ce6912d5 100644 --- a/pom.xml +++ b/pom.xml @@ -43,8 +43,8 @@ UTF-8 UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 true true