Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366782 - Handling of unsigned types by Java generator
Summary: Handling of unsigned types by Java generator
Status: CLOSED FIXED
Alias: None
Product: eTrice
Classification: Modeling
Component: Generators (show other bugs)
Version: 0.1.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: 0.2.0M1
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-15 02:44 EST by Klaus Birken CLA
Modified: 2011-12-16 02:49 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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