r2697 - in trunk/jaxx-compiler/src/main/java/jaxx/compiler: . tags
Author: tchemit Date: 2013-07-10 14:22:43 +0200 (Wed, 10 Jul 2013) New Revision: 2697 Url: http://nuiton.org/projects/jaxx/repository/revisions/2697 Log: fixes #2739: Regression due to #2731 (Can't use any longer Bean widget API with generic types) Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java 2013-07-09 12:15:16 UTC (rev 2696) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/JAXXCompiler.java 2013-07-10 12:22:43 UTC (rev 2697) @@ -1958,6 +1958,18 @@ return getJavaFile().getImportedType(type); } + public String getImportedTypeForSimpleName(String type) { + String suffix = "."+type; + String result=null; + for (String importedClass : getImportedClasses()) { + if (importedClass.endsWith(suffix)) { + result = importedClass; + break; + } + } + return result; + } + /** * @return the javafile import manager * @since 2.4 Modified: trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java =================================================================== --- trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java 2013-07-09 12:15:16 UTC (rev 2696) +++ trunk/jaxx-compiler/src/main/java/jaxx/compiler/tags/DefaultObjectHandler.java 2013-07-10 12:22:43 UTC (rev 2697) @@ -732,23 +732,17 @@ } } if (ClassDescriptorHelper.getClassDescriptor(BeanTypeAware.class).isAssignableFrom(object.getObjectClass())) { - - try { - String fqn = compiler.getImportedType(value); - ClassDescriptorHelper.getClassDescriptor(fqn); + String fqn = compiler.getImportedTypeForSimpleName(value); + if (fqn!=null) { // add beanType from genericType if (log.isDebugEnabled()) { log.debug("Add beanType property: " + value + " to " + object); } - - setAttribute(object, BeanTypeAware.PROPERTY_BEAN_TYPE, "{" + fqn + ".class}", true, compiler); - } catch (ClassNotFoundException e) { - // not a class, must be a reference to another generic type - if (log.isDebugEnabled()) { - log.debug("Could not find beanType from value "+value); - } + setAttribute(object, BeanTypeAware.PROPERTY_BEAN_TYPE, "{" + value + ".class}", true, compiler); } + + } }
participants (1)
-
tchemit@users.nuiton.org