Issue Details (XML | Word | Printable)

Key: GDS-642
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Franck Wolff
Reporter: Matt Davis
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
GraniteDS

Compile Error with GAS3 Generation of Abstract Java Classes Implementing Interfaces

Created: 02/Mar/10 07:18 PM   Updated: 11/Aug/10 06:49 PM   Resolved: 02/Jul/10 05:48 PM
Component/s: AS3 code generation
Affects Version/s: 2.1.0_RC2
Fix Version/s: 2.2.0_beta1

Environment: JBoss 5.1.0
Issue Links:
Dependent
 


 Description  « Hide
On the java side, I have an abstract class Abstract Entity.
AbstractEntity implements EntityInterface
EntityInterface contains one method: "getString()"

AbstractEntity does not implement the getString() method.

OtherAbstractEntity extends AbstractEntity.

ConcreteEntity extends OtherAbstractEntity.

ConcreteEntity implements getString();

When the code is generated by GAS3, there is a method in AbstractEntityBase:

public function getString():String{
return null;
}


There is also a function generated in ConcreteEntityBase (which extends AbstractEntityBase):
public function getString():String{
 return _someString;
}


A compile error occurs because ConcreteEntityBase's getString function does not contain the "override" keyword.

Or, you could look at it like -

A compile error occurs because AbstractEntityBase contains a getString function that it shouldn't, because it was an abstract class on the Java side.










Stefan Richter added a comment - 19/Apr/10 04:36 PM
Hi, i have a similar structure and getting Compiler Error 1024 as well.

Here is a simple (and senseless) example to reproduce it:

Mothership.java:

package de.somecompany.services.dao;

import org.granite.messaging.service.annotations.RemoteDestination;
import org.granite.tide.data.DataEnabled;
import org.granite.tide.data.DataEnabled.PublishMode;

import de.somecompany.services.ObserveAllPublishAll;

@RemoteDestination
@DataEnabled(topic="elni", params=ObserveAllPublishAll.class, publish=PublishMode.ON_SUCCESS)
public class Mothership implements IMothership {

public boolean destroyTarget(Object target) {
boolean success=attack();
if (target==null) {
success=true;
}
return success;
}

public boolean attack() {
System.out.println("FIRE WITH DEADLY LASER WEAPON");
return true;
}

}

ChildBomber.java:

package de.somecompany.services.dao;

public class ChildBomber extends Mothership {

@Override
public boolean attack() {
System.out.println("FIRE WITH NOT SO DEADLY MASCHINE GUNS");
return false;
}
}

And two Interfaces:

IMothership.java:

package de.somecompany.services.dao;

public interface IMothership extends IAlienship {

public boolean attack();

}

IAlienship.java:

package de.somecompany.services.dao;

public interface IAlienship {
public boolean destroyTarget(Object target);
}

I'm using the Tide Entities.

Franck Wolff added a comment - 02/Jul/10 05:48 PM
Fixed in the trunk.