yyang-talend / gwt-ent

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

ReflectAllInOneCreator processClass method causes infinite loop #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. If the reflectable class , or its dependent classs has an annotation whose 
value is this class, then processClass enters infinite loop.

for example,

@DomainClass(TtBina.class)
public interface ITtBina {}

public class TtBina implements ITtBina,Reflection{}

I have patched addClassIfNotExists and processClass methods as below. 

private void processClass(JClassType classType, Reflectable reflectable) {
   if (! genExclusion(classType)){
      if (addClassIfNotExists(classType, reflectable)) { 
     processRelationClasses(classType, reflectable);
     processAnnotationClasses(classType, reflectable);
      }

    }
}

private boolean addClassIfNotExists(JClassType classType, Reflectable setting){
        //Add next line we can make sure we just append normal class type, always get from TypeOracle
        //not JParameterizedType or JTypeParameter etc...
        if (classType != null){
//          System.out.println("addClassIfNotExists: " + 
classType.getQualifiedSourceName());
            classType = this.typeOracle.findType(classType.getQualifiedSourceName());
        }

        //we just process public classes
        if ((classType == null) || (!classType.isPublic()))
          return false;  

        if (candidateList.indexOf(classType) < 0) {
            candidateList.add(classType);
            candidates.put(classType, setting);
            return true;
        }
        return false;
    }

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
gwt-ent 1.0.0.RC1

Please provide any additional information below.

Original issue reported on code.google.com by gurselk...@gmail.com on 26 Aug 2010 at 2:26

GoogleCodeExporter commented 8 years ago
Thank you very much gurselkoca, I will add to next release.

Original comment by JamesLuo...@gmail.com on 26 Aug 2010 at 11:04

GoogleCodeExporter commented 8 years ago

Original comment by JamesLuo...@gmail.com on 27 Aug 2010 at 4:55