Fixes a build break from rev 3073. Wrapper types that are not used in a program are not present, so don't rely on being able to look up all wrapper types. Review by: scottb (postmortem) git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/1.5@3076 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/AutoboxUtils.java b/dev/core/src/com/google/gwt/dev/jjs/impl/AutoboxUtils.java index b9caf67..4a2a06a 100644 --- a/dev/core/src/com/google/gwt/dev/jjs/impl/AutoboxUtils.java +++ b/dev/core/src/com/google/gwt/dev/jjs/impl/AutoboxUtils.java
@@ -65,6 +65,10 @@ return box(toBox, primitiveType, wrapperType); } + /** + * Return the box class for a given primitive. Note that this can return <code>null</code> + * if the source program does not actually need the requested box type. + */ public JClassType boxClassForPrimitive(JPrimitiveType prim) { return (JClassType) program.getFromTypeMap(prim.getWrapperTypeName()); } @@ -145,11 +149,13 @@ private void computeUnboxMethods() { unboxMethods = new LinkedHashSet<JMethod>(); for (JReferenceType boxType : boxTypes) { - for (JMethod method : boxType.methods) { - if (!method.isStatic() && method.params.isEmpty() - && method.getName().endsWith("Value") - && (method.getType() instanceof JPrimitiveType)) { - unboxMethods.add(method); + if (boxType != null) { + for (JMethod method : boxType.methods) { + if (!method.isStatic() && method.params.isEmpty() + && method.getName().endsWith("Value") + && (method.getType() instanceof JPrimitiveType)) { + unboxMethods.add(method); + } } } }