Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366782

Summary: Handling of unsigned types by Java generator
Product: [Modeling] eTrice Reporter: Klaus Birken <klaus.birken>
Component: GeneratorsAssignee: Project Inbox <etrice.generators-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: hrr, ts
Version: 0.1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: 0.2.0M1

Description Klaus Birken CLA 2011-12-15 02:44:28 EST
Java doesn't support unsigned types, but the ROOM language supports them. Currently the dummy "undefined_type" is generated by eTrice's Java generator.
It would be better to issue a generator error if the Java generator encounters these types.

It would also be a nice extension for the generator to support the option "mapUnsignedTypes", which does a mapping:
uint8 => Java int
uint16 => Java int
uint32 => Java long
uint64 => BigInteger (currently uint64 is not supported by eTrice's ROOM language).

Without this option, a user would be stuck if porting an existing ROOM model to a Java environment.

BTW: There is a nice page explaining the details:
    http://www.javamex.com/java_equivalents/unsigned.shtml
Comment 1 Henrik Rentz-Reichert CLA 2011-12-15 04:17:40 EST
For ROOM primitive types that can't be mapped to Java types an error message is printed and the code generation is terminated.

Done with
8ea6a8c215986e859eb47e202c083f13c8d830b7

It still needs to be discussed whether something like the proposed "mapUnsignedTypes" option should be implemented.
Comment 2 Henrik Rentz-Reichert CLA 2011-12-15 05:28:38 EST
(In reply to comment #1)
> 
> It still needs to be discussed whether something like the proposed
> "mapUnsignedTypes" option should be implemented.

I've opened bug 366798 to track this.
Comment 3 Henrik Rentz-Reichert CLA 2011-12-16 02:48:07 EST
tagged as version 0.1.0