yyang-talend / gwt-ent

Automatically exported from code.google.com/p/gwt-ent
0 stars 0 forks source link

unavailable annotations should be handled gracefully - re-open #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Create @Persistent @Embedded members for an AppEngine application.

What is the expected output? 

Do not expect runtime errors

What do you see instead?

Errors at at 
com.gwtent.gen.reflection.GeneratorHelper.addAnnotation(GeneratorHelper.jav
a:151)

because Annotation type field is null and the GWT ENT code calls:

annotation.annotationType().getName()

If AppEngine is not generating the right stuff, then I suppose this error 
is correct. However, if it is possible for annotation to not have a type, 
then annotations with the null type should just be ignored.

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by syblackw...@gmail.com on 16 Aug 2009 at 9:00

GoogleCodeExporter commented 8 years ago
Hi, syblackwell, Can you give me the sample code? Thanks

Original comment by JamesLuo...@gmail.com on 19 Aug 2009 at 12:20

GoogleCodeExporter commented 8 years ago
Thnaks for responding to my initial post. I am using gwtEnt 0.5 because .6 
generates 
a massive number of errors due to GWT source not found issues. Although these 
are 
unrelated to gwtEnt code that I use and don't prevent my code from running, it 
creates a lot of debug noise. It would be helpful if you provided more separate 
jar 
files.

Here is my usage of gwtEnt (assume "property" is a String name of a valid class 
member and "bean" is a valid Object implementing Reflection:

            ClassType classType = 
TypeOracle.Instance.getClassType(bean.getClass());
            String gettername = "get" + 
property.substring(0,1).toUpperCase() + property.substring(1);
            Method getter = classType.findMethod(gettername, new 
Type[]{});
            Type returntype = getter.getReturnType();
            return returntype.getClass();

Here is a sample class:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Goal implements Serializable,BeanModelTag,Reflection {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
    public String uid;

    @Persistent(embedded="true")
    private TimeFrame timeFrame = new TimeFrame();

    @Persistent
    private String name = "";

    public Goal() { 
        }

    public String getName() { return name;  }

    public void setName(String name) { this.name = name; }

        public TimeFrame getTimeFrame() {
        return timeFrame;
    }
    public void setTimeFrame(TimeFrame data) {
        timeFrame.set(data);
    }
}

Original comment by syblackw...@gmail.com on 22 Aug 2009 at 10:03

GoogleCodeExporter commented 8 years ago
Hi,syblackwell, I made that change, now GWTENT only print an log to log tree and
continue the work. thanks

Original comment by JamesLuo...@gmail.com on 15 Sep 2009 at 5:36