polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject zest-java git commit: Upgrading to Java 8, and increasing Restlet to 2.3.4 plus fixing what breaks with it.
Date Sat, 01 Aug 2015 04:55:47 GMT
Repository: zest-java
Updated Branches:
  refs/heads/develop ca3966788 -> a35a4e37c


Upgrading to Java 8, and increasing Restlet to 2.3.4 plus fixing what breaks with it.


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/a35a4e37
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/a35a4e37
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/a35a4e37

Branch: refs/heads/develop
Commit: a35a4e37c8b2f4c60332551a5852880d09dcf93b
Parents: ca39667
Author: Niclas Hedhman <niclas@hedhman.org>
Authored: Sat Aug 1 12:55:38 2015 +0800
Committer: Niclas Hedhman <niclas@hedhman.org>
Committed: Sat Aug 1 12:55:38 2015 +0800

----------------------------------------------------------------------
 build.gradle                                    |  6 +--
 libraries.gradle                                |  4 +-
 .../rest/client/api/ContextResourceClient.java  | 44 --------------------
 .../ValueCompositeRequestWriter.java            |  2 +-
 .../library/rest/admin/RestApplication.java     | 12 +++---
 5 files changed, 12 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/a35a4e37/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 066dc99..fdee8f9 100644
--- a/build.gradle
+++ b/build.gradle
@@ -49,8 +49,8 @@ apply plugin: 'project-report'
 apply from: 'libraries.gradle'
 apply plugin: 'org.nosphere.apache.rat'
 
-targetCompatibility = "1.7"
-sourceCompatibility = "1.7"
+targetCompatibility = "1.8"
+sourceCompatibility = "1.8"
 
 // Collect the modules that fulfills the Release Criteria.
 project.ext {
@@ -372,7 +372,7 @@ allprojects {
       }
     }
     jacoco {
-      toolVersion = '0.7.2.201409121644'
+      toolVersion = '0.7.5.201505241946'
     }
 
 //    // Create checkstyle report

http://git-wip-us.apache.org/repos/asf/zest-java/blob/a35a4e37/libraries.gradle
----------------------------------------------------------------------
diff --git a/libraries.gradle b/libraries.gradle
index 862295a..13c7525 100644
--- a/libraries.gradle
+++ b/libraries.gradle
@@ -54,7 +54,7 @@ def osgiVersion = '4.2.0' // 4.3.0 Fails to compile! - 5.0.0 exists
 def pdfboxVersion = '1.8.5'
 def postgresqlVersion = '9.4-1201-jdbc41'
 def prefuseVersion = '0.21'
-def restletVersion = '2.0.15' // 2.2.1 Fails to compile!
+def restletVersion = '2.3.4'
 def rdfVersion = '2.7.9'
 def riakVersion = '1.4.4' // 2.0.x Fails to compile!
 def scalaVersion = '2.11.6'
@@ -115,7 +115,7 @@ rootProject.ext {
           // Restlet
           restlet: [
                   "org.restlet.jee:org.restlet:$restletVersion",
-                  "org.restlet.jee:org.restlet.ext.ssl:$restletVersion",
+//                  "org.restlet.jee:org.restlet.ext.ssl:$restletVersion",
                   "org.restlet.jee:org.restlet.ext.atom:$restletVersion",
                   "org.restlet.jee:org.restlet.ext.servlet:$restletVersion",
                   "org.restlet.jee:org.restlet.ext.slf4j:$restletVersion"

http://git-wip-us.apache.org/repos/asf/zest-java/blob/a35a4e37/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/api/ContextResourceClient.java
----------------------------------------------------------------------
diff --git a/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/api/ContextResourceClient.java
b/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/api/ContextResourceClient.java
index 597eeb1..59d3302 100644
--- a/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/api/ContextResourceClient.java
+++ b/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/api/ContextResourceClient.java
@@ -436,50 +436,6 @@ public class ContextResourceClient
         return contextResourceFactory.newClient( reference );
     }
 
-    // Internal
-    private Object handlxeError( Response response )
-        throws ResourceException
-    {
-        if( response.getStatus().equals( Status.SERVER_ERROR_INTERNAL ) )
-        {
-            if( MediaType.APPLICATION_JAVA_OBJECT.equals( response.getEntity().getMediaType()
) )
-            {
-                try
-                {
-                    Object exception = new ObjectRepresentation( response.getEntity() ).getObject();
-                    throw new ResourceException( (Throwable) exception );
-                }
-                catch( IOException e )
-                {
-                    throw new ResourceException( e );
-                }
-                catch( ClassNotFoundException e )
-                {
-                    throw new ResourceException( e );
-                }
-            }
-
-            throw new ResourceException( Status.SERVER_ERROR_INTERNAL, response.getEntityAsText()
);
-        }
-        else
-        {
-            if( response.getEntity() != null )
-            {
-                String text = response.getEntityAsText();
-                throw new ResourceException( response.getStatus().getCode(), response.getStatus()
-                    .getName(), text, response.getRequest().getResourceRef().toUri().toString()
);
-            }
-            else
-            {
-                throw new ResourceException( response.getStatus().getCode(), response.getStatus()
-                    .getName(), response.getStatus().getDescription(), response.getRequest()
-                    .getResourceRef()
-                    .toUri()
-                    .toString() );
-            }
-        }
-    }
-
     @Override
     public String toString()
     {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/a35a4e37/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/requestwriter/ValueCompositeRequestWriter.java
----------------------------------------------------------------------
diff --git a/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/requestwriter/ValueCompositeRequestWriter.java
b/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/requestwriter/ValueCompositeRequestWriter.java
index 18cf41c..6bd5571 100644
--- a/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/requestwriter/ValueCompositeRequestWriter.java
+++ b/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/requestwriter/ValueCompositeRequestWriter.java
@@ -98,7 +98,7 @@ public class ValueCompositeRequestWriter
                     throws IOException
                 {
                    setCharacterSet( CharacterSet.UTF_8 );
-                   valueSerializer.serialize( valueObject, new WriterOutputStream( writer
) );
+                   valueSerializer.serialize( valueObject, new WriterOutputStream( writer,
CharacterSet.UTF_8 ) );
                 }
             });
          }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/a35a4e37/libraries/rest/src/main/java/org/apache/zest/library/rest/admin/RestApplication.java
----------------------------------------------------------------------
diff --git a/libraries/rest/src/main/java/org/apache/zest/library/rest/admin/RestApplication.java
b/libraries/rest/src/main/java/org/apache/zest/library/rest/admin/RestApplication.java
index 165fe3d..aa28069 100644
--- a/libraries/rest/src/main/java/org/apache/zest/library/rest/admin/RestApplication.java
+++ b/libraries/rest/src/main/java/org/apache/zest/library/rest/admin/RestApplication.java
@@ -84,17 +84,17 @@ public class RestApplication
     {
         Router router = new Router( getContext() );
 
-        router.attach( "/entity", createFinder( EntitiesResource.class ) );
-        router.attach( "/entity/{identity}", createFinder( EntityResource.class ) );
+        router.attach( "/entity", newFinder( EntitiesResource.class ) );
+        router.attach( "/entity/{identity}", newFinder( EntityResource.class ) );
 
-        router.attach( "/query", createFinder( SPARQLResource.class ) );
-        router.attach( "/query/sparqlhtml", createFinder( SPARQLResource.class ) );
-        router.attach( "/query/index", createFinder( IndexResource.class ) );
+        router.attach( "/query", newFinder( SPARQLResource.class ) );
+        router.attach( "/query/sparqlhtml", newFinder( SPARQLResource.class ) );
+        router.attach( "/query/index", newFinder( IndexResource.class ) );
 
         return router;
     }
 
-    private Finder createFinder( Class<? extends ServerResource> resource )
+    private Finder newFinder( Class<? extends ServerResource> resource )
     {
         Finder finder = module.newObject( Finder.class );
         finder.setTargetClass( resource );


Mime
View raw message