Commits

Tobias Westerblom committed 8ab5b03

fixed java uint32 list generation bug

Comments (0)

Files changed (2)

maven/protocol-generator-plugin/src/main/scripts/java_generator.rb

       wi("public byte[] #{camelcase(list.name)} = new byte[0];")
       result = "byte[]"   
     elsif(builtin?(list.obj_type))
+      # If complex type, then use List 
+      if (UNSIGNED_TYPES.has_key?(type))
+        type = UNSIGNED_TYPES[type]
+      end
+    
       # If primitive, then use array instead of List  	
       wi("public #{type}[] #{camelcase(list.name)} = new #{type}[0];")
       result = "#{type}[]"
       # If complex type, then use List 
       if (UNSIGNED_TYPES.has_key?(type))
         type = UNSIGNED_TYPES[type]
-        
       end
       wi("public List<#{type}> #{camelcase(list.name)};")
       result = "List<#{type}>"

maven/protocol-tests/java-test/src/test/resources/protocol.xml

     	<list name="l" type="int64" />
     </struct>
     
-    <struct id="8" name="list_of_uints_64">
-    	<list name="l" type="uint64" />
+    <struct id="8" name="list_of_uint32">
+    	<list name="l" type="uint32" />
     </struct>
-  
+    
 </protocol>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.