This is an automated email from the git hooks/post-receive script. New commit to annotated tag v2.0.0-beta-2 in repository jaxx. See https://gitlab.nuiton.org/nuiton/jaxx.git commit 74de155771fe1111c35055baca8e80ece7d04491 Author: Tony Chemit <chemit@codelutin.com> Date: Fri Nov 27 01:43:31 2009 +0000 add log and do not break build when a binding is bad (since it can not be for the moment...) --- .../java/jaxx/compiler/binding/DataSource.java | 28 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataSource.java b/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataSource.java index 1e5da72..0874f8c 100644 --- a/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataSource.java +++ b/jaxx-compiler/src/main/java/jaxx/compiler/binding/DataSource.java @@ -37,6 +37,8 @@ import jaxx.compiler.reflect.MethodDescriptor; import jaxx.compiler.tags.DefaultObjectHandler; import jaxx.compiler.tags.TagManager; import jaxx.compiler.types.TypeManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.beans.Introspector; import java.beans.PropertyChangeListener; @@ -45,9 +47,6 @@ import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Represents a Java expression which fires a <code>PropertyChangeEvent</code> when it can be * determined that its value may have changed. Events are fired on a "best effort" basis, and events @@ -388,6 +387,9 @@ public class DataSource { * @return the type of the symbol (or null if it could not be determined). */ private ClassDescriptor scanCompoundSymbol(String symbol, ClassDescriptor contextClass, boolean isMethod) { + if (log.isDebugEnabled()) { + log.debug("for symbol " + symbol + " and contextClass " + contextClass + ", isMethod " + isMethod); + } String[] tokens = symbol.split("\\s*\\.\\s*"); StringBuffer currentSymbol = new StringBuffer(); StringBuffer tokensSeenSoFar = new StringBuffer(); @@ -418,7 +420,13 @@ public class DataSource { try { FieldDescriptor field = contextClass.getFieldDescriptor(memberName); trackMemberIfPossible(tokensSeenSoFar.toString(), contextClass, field.getName(), false); - contextClass = field.getType(); + try { + contextClass = field.getType(); + } catch (Exception e) { + log.warn("could not find type for field " + field); + throw new NoSuchFieldException(e.getMessage()); + } + currentSymbol.setLength(0); accepted = true; recognizeClassNames = false; @@ -427,16 +435,26 @@ public class DataSource { FieldDescriptor[] newFields = compiler.getScriptFields(); for (FieldDescriptor newField : newFields) { if (newField.getName().equals(memberName)) { + try { + contextClass = newField.getType(); + } catch (Exception e2) { + // try to get a generic type + CompiledObject compiledObject = compiler.getCompiledObject(newField.getName()); + log.warn("could not find type for field " + newField + " membername " + memberName + ", compiledObject : " + compiledObject); + contextClass = null; + continue; + } addListener(tokensSeenSoFar.toString(), null, "addPropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator(), "removePropertyChangeListener(\"" + memberName + "\", " + listenerId + ");" + JAXXCompiler.getLineSeparator()); - contextClass = newField.getType(); + assert contextClass != null : "script field '" + memberName + "' is defined, but has type null"; currentSymbol.setLength(0); accepted = true; recognizeClassNames = false; break; + } } } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.