You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gora.apache.org by hs...@apache.org on 2014/06/12 19:24:59 UTC

[1/2] git commit: GORA-331 add missing enum.vm template for compiler | by Damien Raude-Morvan

Repository: gora
Updated Branches:
  refs/heads/master 0778e5671 -> 4ac1171d8


GORA-331 add missing enum.vm template for compiler | by Damien Raude-Morvan


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/148ca981
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/148ca981
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/148ca981

Branch: refs/heads/master
Commit: 148ca981db5e2abbfbd128b5a8419ec5344ffdc7
Parents: 0778e56
Author: Henry Saputra <he...@gmail.com>
Authored: Thu Jun 12 09:52:32 2014 -0700
Committer: Henry Saputra <he...@gmail.com>
Committed: Thu Jun 12 09:52:32 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 ++
 .../org/apache/gora/compiler/templates/enum.vm  | 35 ++++++++++++++++++++
 2 files changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/148ca981/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 7271006..870e19b 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,6 +4,8 @@
 
 Current Development 0.5-SNAPSHOT
 
+* GORA-331 Gora 0.4 compiler crash with "enum" type (drazzib aka Damien Raude-Morvan via hsaputra)
+
 * GORA-336 MongoFilterUtil: missing ref link when creating new instance of factory (drazzib via lewismc)
 
 * GORA-260 Make Solrj solr server impl configurable from within gora.properties (lewismc)

http://git-wip-us.apache.org/repos/asf/gora/blob/148ca981/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/enum.vm
----------------------------------------------------------------------
diff --git a/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/enum.vm b/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/enum.vm
new file mode 100644
index 0000000..bba40bd
--- /dev/null
+++ b/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/enum.vm
@@ -0,0 +1,35 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##     http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+#if ($schema.getNamespace())
+package $schema.getNamespace();
+#end
+@SuppressWarnings("all")
+#if ($schema.getDoc())
+/** $schema.getDoc() */
+#end
+#foreach ($annotation in $this.javaAnnotations($schema))
+@$annotation
+#end
+@org.apache.avro.specific.AvroGenerated
+public enum ${this.mangle($schema.getName())} {
+  #foreach ($symbol in ${schema.getEnumSymbols()})${this.mangle($symbol)}#if ($velocityHasNext), #end#end
+  ;
+  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("${this.javaEscape($schema.toString())}");
+  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
+}
+


[2/2] git commit: GORA-332 fix record.vm template to generate deepCopyToReadOnlyBuffer methos | by Damien Raude-Morvan

Posted by hs...@apache.org.
GORA-332 fix record.vm template to generate deepCopyToReadOnlyBuffer methos | by Damien Raude-Morvan


Project: http://git-wip-us.apache.org/repos/asf/gora/repo
Commit: http://git-wip-us.apache.org/repos/asf/gora/commit/4ac1171d
Tree: http://git-wip-us.apache.org/repos/asf/gora/tree/4ac1171d
Diff: http://git-wip-us.apache.org/repos/asf/gora/diff/4ac1171d

Branch: refs/heads/master
Commit: 4ac1171d854bcf27ca29e5da57b90916db955b98
Parents: 148ca98
Author: Henry Saputra <he...@gmail.com>
Authored: Thu Jun 12 09:57:50 2014 -0700
Committer: Henry Saputra <he...@gmail.com>
Committed: Thu Jun 12 09:57:50 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt                                                     | 2 ++
 .../main/velocity/org/apache/gora/compiler/templates/record.vm  | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/4ac1171d/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 870e19b..111ff20 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,6 +4,8 @@
 
 Current Development 0.5-SNAPSHOT
 
+* GORA-332 fix record.vm template to generate deepCopyToReadOnlyBuffer method (drazzib aka Damien Raude-Morvan via hsaputra)
+
 * GORA-331 Gora 0.4 compiler crash with "enum" type (drazzib aka Damien Raude-Morvan via hsaputra)
 
 * GORA-336 MongoFilterUtil: missing ref link when creating new instance of factory (drazzib via lewismc)

http://git-wip-us.apache.org/repos/asf/gora/blob/4ac1171d/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/record.vm
----------------------------------------------------------------------
diff --git a/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/record.vm b/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/record.vm
index 0a73b80..78f5d13 100644
--- a/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/record.vm
+++ b/gora-compiler/src/main/velocity/org/apache/gora/compiler/templates/record.vm
@@ -172,7 +172,7 @@ public class ${this.mangle($schema.getName())}#if ($schema.isError()) extends or
     return new #if ($schema.getNamespace())$schema.getNamespace().#end${this.mangle($schema.getName())}.Builder(other);
   }
   
-  private static java.nio.ByteBuffer deepCopyToWriteOnlyBuffer(
+  private static java.nio.ByteBuffer deepCopyToReadOnlyBuffer(
       java.nio.ByteBuffer input) {
     java.nio.ByteBuffer copy = java.nio.ByteBuffer.allocate(input.capacity());
     int position = input.position();
@@ -346,4 +346,5 @@ public class ${this.mangle($schema.getName())}#if ($schema.isError()) extends or
   
   }
   
-}
\ No newline at end of file
+}
+