polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [2/2] zest-java git commit: library:rest:minor: fix deprecation warnings
Date Sun, 03 Jul 2016 13:31:43 GMT
library:rest:minor: fix deprecation warnings


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

Branch: refs/heads/develop
Commit: 543bb6ae407fb6879f3fb521d788c3df4b81911c
Parents: 31e3530
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sun Jul 3 15:31:27 2016 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sun Jul 3 15:31:27 2016 +0200

----------------------------------------------------------------------
 .../library/rest/server/assembler/RestServerAssembler.java  | 9 ++++++---
 .../restlet/freemarker/ValueCompositeObjectWrapper.java     | 6 ++++++
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/543bb6ae/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/assembler/RestServerAssembler.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/assembler/RestServerAssembler.java
b/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/assembler/RestServerAssembler.java
index ac0d448..a9ee8ac 100644
--- a/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/assembler/RestServerAssembler.java
+++ b/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/assembler/RestServerAssembler.java
@@ -20,6 +20,8 @@
 
 package org.apache.zest.library.rest.server.assembler;
 
+import freemarker.template.Configuration;
+import freemarker.template.Version;
 import java.lang.reflect.Modifier;
 import java.util.Properties;
 import java.util.function.Predicate;
@@ -71,11 +73,12 @@ public class RestServerAssembler
             throw new AssemblyException( "Could not load velocity properties", e );
         }
 
-        freemarker.template.Configuration cfg = new freemarker.template.Configuration();
+        Version freemarkerVersion = Configuration.DEFAULT_INCOMPATIBLE_IMPROVEMENTS;
+        Configuration cfg = new Configuration( freemarkerVersion );
         cfg.setClassForTemplateLoading( AbstractResponseWriter.class, "" );
-        cfg.setObjectWrapper( new ValueCompositeObjectWrapper() );
+        cfg.setObjectWrapper( new ValueCompositeObjectWrapper( freemarkerVersion ) );
 
-        module.importedServices( freemarker.template.Configuration.class ).setMetaInfo( cfg
);
+        module.importedServices( Configuration.class ).setMetaInfo( cfg );
 
         module.importedServices( MetadataService.class );
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/543bb6ae/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/freemarker/ValueCompositeObjectWrapper.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/freemarker/ValueCompositeObjectWrapper.java
b/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/freemarker/ValueCompositeObjectWrapper.java
index eac1e9c..a343a4f 100644
--- a/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/freemarker/ValueCompositeObjectWrapper.java
+++ b/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/freemarker/ValueCompositeObjectWrapper.java
@@ -22,6 +22,7 @@ package org.apache.zest.library.rest.server.restlet.freemarker;
 import freemarker.template.DefaultObjectWrapper;
 import freemarker.template.TemplateModel;
 import freemarker.template.TemplateModelException;
+import freemarker.template.Version;
 import org.apache.zest.api.value.ValueComposite;
 
 /**
@@ -30,6 +31,11 @@ import org.apache.zest.api.value.ValueComposite;
 public class ValueCompositeObjectWrapper
     extends DefaultObjectWrapper
 {
+    public ValueCompositeObjectWrapper( Version freemarkerVersion )
+    {
+        super( freemarkerVersion );
+    }
+
     @Override
     public TemplateModel wrap( Object obj )
         throws TemplateModelException


Mime
View raw message