Mercurial > hg > truffle
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java @ 20952:833e088ee7d3
Truffle-DSL: fixed invalid execute delegation
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 14 Apr 2015 19:41:36 +0200 |
parents | 810d466073f0 |
children | 05a2b72c071f |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java Tue Apr 14 19:23:33 2015 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/java/ElementUtils.java Tue Apr 14 19:41:36 2015 +0200 @@ -147,13 +147,14 @@ return result; } - public static TypeMirror getCommonSuperType(ProcessorContext context, TypeMirror[] types) { - if (types.length == 0) { + public static TypeMirror getCommonSuperType(ProcessorContext context, Collection<TypeMirror> types) { + if (types.isEmpty()) { return context.getType(Object.class); } - TypeMirror prev = types[0]; - for (int i = 1; i < types.length; i++) { - prev = getCommonSuperType(context, prev, types[i]); + Iterator<TypeMirror> typesIterator = types.iterator(); + TypeMirror prev = typesIterator.next(); + while (typesIterator.hasNext()) { + prev = getCommonSuperType(context, prev, typesIterator.next()); } return prev; }