Mod4j: Modeling for Java using Domain Specific Languages

toBeRemoved variable generated mutiple times

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1.0
  • Fix Version/s: 1.2.0
  • Component/s: DSL for Data Contract
  • Labels:
    None
  • Number of attachments :
    0

Description

Compiler error when a dto class declares more then one reference to a to-many association. In the synchronisation part of the corresponding dto translator, each reference will get a toBeRemoved variable declared. That does not make the compiler happy.

// datacontract example

    class SimpleCustomerDto represents Customer [  
        customerNr; 
        references [  
            orders as OrderNumberAndDateList;
            idols as ArtistListDto;  
        ]    
    ]
public class SimpleCustomerDtoTranslator {

    ...
    /*
     * Synchronize Orders association.
     */
     Set<Order> toBeRemoved = new HashSet<Order>();
    ...

   /*
    * Synchronize Idols association.
    */
    Set<Artist> toBeRemoved = new HashSet<Artist>();  //Compiler error: Duplicate local variable toBeRemoved
    ...

Activity

Hide
Johan Vogelzang added a comment -

Done

Show
Johan Vogelzang added a comment - Done

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: