Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-298

RpcProxyLoaderGenerator FAILS when the Service extends a base service - Needs to include @Override in generated output

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Partially Completed
    • Affects Version/s: 2.0.CR2
    • Fix Version/s: 2.0.1.Final
    • Component/s: ErraiBus
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Create

      
      @Remote
      interface ServiceA<E extends BaseEntity> {
      
         public void create( E entity )
      }
      
      @Remote
      interface ServiceB extends ServiceA<SpecificEntity> {
      
      }
      
      
      @Service
      class ServiceAImpl<E extends BaseEntity> implements ServiceA<E> {
      
         public void create( E entity ) {
      
         }
      }
      
      @Service
      public class ServiceBImpl extends ServiceAImpl<SpecificEntity> implements ServiceB {
      
      
      }
      
      

      When the generator runs, it attempts to create something like:

      
         class ServiceBImpl implements ServiceB, RPCStub {
      
            public void create(BaseEntity a0) {
      
               ....
            }
      
         }
      
      

      Notice the dropped generic (this might not matter, or be avoidable), but it is erroring because the create method does not have an @Override annotation. Also the CDI endpoint ServiceBImpl.create(SpecificEntity entity) is never registered.

      Show
      Create @Remote interface ServiceA<E extends BaseEntity> { public void create( E entity ) } @Remote interface ServiceB extends ServiceA<SpecificEntity> { } @Service class ServiceAImpl<E extends BaseEntity> implements ServiceA<E> { public void create( E entity ) { } } @Service public class ServiceBImpl extends ServiceAImpl<SpecificEntity> implements ServiceB { } When the generator runs, it attempts to create something like: class ServiceBImpl implements ServiceB, RPCStub { public void create(BaseEntity a0) { .... } } Notice the dropped generic (this might not matter, or be avoidable), but it is erroring because the create method does not have an @Override annotation. Also the CDI endpoint ServiceBImpl.create(SpecificEntity entity) is never registered.

      Description

      There are two services, ServiceA<E extends BaseEntity> and ServiceB<SpecificEntity> extends ServiceA<E>.
      ServiceA has a method create( E x);

      When the RpcProxyLoaderGenerator generates the proxy for ServiceBImpl, it puts all methods in the impl, including the ones inherited from ServiceA. The generated ServiceBImpl does not extend ServiceAimpl, but includes all methods from ServiceA AND ServiceB. It looks like there are the following problems:

      • It does not handle the generics, and the references to the SpecificEntity are dropped and replaced with BaseEntity
      • the create( BaseEntity x) that is generated does not @Override. GWT compilation fails: [ERROR] Line 43: The type ServiceBImpl must implement the inherited abstract method ServiceA<SpecificEntity>.create(SpecificEntity x)

      Another Problem:
      Conversational Endpoints are not created on the server for extended interfaces. I'm not sure if this would be fixed by the above, but when generating conversational endpoints, it is not creating ServiceA.create(SpecificEntity entity), so even though the client is able to send the message (in dev mode), the server doesn't respond.

      It works fine in development mode. Not being able to use inheritance/generics in services is a bit of a show stopper.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  csa Christian Sadilek
                  Reporter:
                  jblinick Josh B
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: