From a8b5392bd6b86ca0e9f60dcb49af54965fcb96a7 Mon Sep 17 00:00:00 2001 From: David Russell Date: Tue, 10 Feb 2015 09:48:54 +0700 Subject: [PATCH] RW-628: Updated library for Java 6 compatibility. --- build.gradle | 7 +++++-- examples/awt/build.gradle | 7 +++++-- examples/tutorial/build.gradle | 7 +++++-- .../java/com/revo/deployr/client/call/AbstractCall.java | 7 +------ .../java/com/revo/deployr/client/util/REntityUtil.java | 2 +- test/build.gradle | 5 ++++- test/src/test/java/com/revo/deployr/DeployrUtil.java | 2 +- 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index 3cec7f9..82f0678 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,8 @@ apply plugin: 'java' +sourceCompatibility = "1.6" +targetCompatibility = "1.6" + repositories { mavenCentral() } @@ -19,11 +22,11 @@ dependencies { jar { baseName = 'jDeployR' - version = '7.3.0' + version = '7.4.0' } javadoc { - title = "DeployR 7.3.0 Java Client Library" + title = "DeployR Java Client Library" options.overview = "src/main/java/overview.html" exclude "com/revo/deployr/client/core/**/*.java" exclude "com/revo/deployr/client/call/**/*.java" diff --git a/examples/awt/build.gradle b/examples/awt/build.gradle index b146448..d2ba658 100644 --- a/examples/awt/build.gradle +++ b/examples/awt/build.gradle @@ -1,9 +1,12 @@ apply plugin: 'java' apply plugin: 'application' +sourceCompatibility = "1.6" +targetCompatibility = "1.6" + mainClassName = 'com.revo.deployr.example.SimpleConsole' -applicationDefaultJvmArgs = ["-Dendpoint=http://localhost:7300/deployr", +applicationDefaultJvmArgs = ["-Dendpoint=http://localhost:7400/deployr", "-Dusername=testuser", "-Dpassword=changeme"] @@ -27,7 +30,7 @@ dependencies { jar { baseName = 'deployr-example' - version = '7.3.0' + version = '7.4.0' } task wrapper(type: Wrapper) { diff --git a/examples/tutorial/build.gradle b/examples/tutorial/build.gradle index 3446b1b..c6ec30c 100644 --- a/examples/tutorial/build.gradle +++ b/examples/tutorial/build.gradle @@ -1,7 +1,10 @@ apply plugin: 'java' apply plugin: 'application' -applicationDefaultJvmArgs = ["-Dendpoint=http://localhost:7300/deployr", +sourceCompatibility = "1.6" +targetCompatibility = "1.6" + +applicationDefaultJvmArgs = ["-Dendpoint=http://localhost:7400/deployr", "-Dusername=testuser", "-Dpassword=changeme"] @@ -25,7 +28,7 @@ dependencies { jar { baseName = 'client-tutorial' - version = '7.3.0' + version = '7.4.0' } task execute(type: JavaExec) { diff --git a/src/main/java/com/revo/deployr/client/call/AbstractCall.java b/src/main/java/com/revo/deployr/client/call/AbstractCall.java index 3630776..a5d51ef 100644 --- a/src/main/java/com/revo/deployr/client/call/AbstractCall.java +++ b/src/main/java/com/revo/deployr/client/call/AbstractCall.java @@ -173,12 +173,7 @@ protected RCoreResult makeRequest(HttpUriRequest httpUriRequest, String API) { pResult = new RCoreResultImpl(); - try { - pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase()); - } catch (Throwable tex) { - log.warn("AbstractCall: makeRequest pResult.parseMarkup throwable=" + tex); - throw tex; - } + pResult.parseMarkup(markup, API, statusLine.getStatusCode(), statusLine.getReasonPhrase()); } catch (UnsupportedEncodingException ueex) { log.warn("AbstractCall: makeRequest unsupported encoding exception=" + ueex); diff --git a/src/main/java/com/revo/deployr/client/util/REntityUtil.java b/src/main/java/com/revo/deployr/client/util/REntityUtil.java index 9b74493..20193fc 100644 --- a/src/main/java/com/revo/deployr/client/util/REntityUtil.java +++ b/src/main/java/com/revo/deployr/client/util/REntityUtil.java @@ -57,7 +57,7 @@ public static RProjectDetails getProjectDetails(Map project) { } Date modified = null; try { - modified = new Date((long) project.get("lastmodified")); + modified = new Date((Long) project.get("lastmodified")); } catch (Exception lex) { } List authors = (List) project.get("authors"); diff --git a/test/build.gradle b/test/build.gradle index c33650d..73defa9 100644 --- a/test/build.gradle +++ b/test/build.gradle @@ -1,5 +1,8 @@ apply plugin: 'java' +sourceCompatibility = "1.6" +targetCompatibility = "1.6" + repositories { mavenCentral() } @@ -20,7 +23,7 @@ dependencies { } test { - systemProperty "url.property", "localhost:7300" + systemProperty "url.property", "localhost:7400" } task wrapper(type: Wrapper) { diff --git a/test/src/test/java/com/revo/deployr/DeployrUtil.java b/test/src/test/java/com/revo/deployr/DeployrUtil.java index 814c0b1..485bf2a 100644 --- a/test/src/test/java/com/revo/deployr/DeployrUtil.java +++ b/test/src/test/java/com/revo/deployr/DeployrUtil.java @@ -29,7 +29,7 @@ public class DeployrUtil { public static final String SAMPLE_CODE = "demo(graphics); png('sampleArtifact.png'); plot(rnorm(10));"; - public static final String DEFAULT_PORT = "7300"; + public static final String DEFAULT_PORT = "7400"; // Prefix used to denote file or object created for the // purpose of later loading from repository on preloadfile* // or on preloadobject* parameters.