getCastHelper and NULL type

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@792 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 495138c5bf
commit dd02d56566
  1. 2
      jode/jode/type/ArrayType.java
  2. 2
      jode/jode/type/ClassInterfacesType.java

@ -175,6 +175,8 @@ public class ArrayType extends ReferenceType {
* @return the middle type, or null if it is not necessary. * @return the middle type, or null if it is not necessary.
*/ */
public Type getCastHelper(Type fromType) { public Type getCastHelper(Type fromType) {
if (fromType.getTypeCode() == TC_NULL)
return this;
Type hintType = fromType.getHint(); Type hintType = fromType.getHint();
switch (hintType.getTypeCode()) { switch (hintType.getTypeCode()) {
case TC_ARRAY: case TC_ARRAY:

@ -435,6 +435,8 @@ public class ClassInterfacesType extends ReferenceType {
* @return the middle type, or null if it is not necessary. * @return the middle type, or null if it is not necessary.
*/ */
public Type getCastHelper(Type fromType) { public Type getCastHelper(Type fromType) {
if (fromType.getTypeCode() == TC_NULL)
return this;
Type hintType = fromType.getHint(); Type hintType = fromType.getHint();
switch (hintType.getTypeCode()) { switch (hintType.getTypeCode()) {
case TC_ARRAY: case TC_ARRAY:

Loading…
Cancel
Save