Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java @ 15183:b862cf4381ef
don't throw exception for Constant.toValueString with Kind.Illegal
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Thu, 17 Apr 2014 09:59:27 +0200 |
parents | db4254246f9a |
children | e43591136d9f |
comparison
equal
deleted
inserted
replaced
15182:89325b6051ea | 15183:b862cf4381ef |
---|---|
136 * @return the constant value | 136 * @return the constant value |
137 */ | 137 */ |
138 public abstract double asDouble(); | 138 public abstract double asDouble(); |
139 | 139 |
140 public String toValueString() { | 140 public String toValueString() { |
141 return getKind().format(asBoxedPrimitive()); | 141 if (getKind() == Kind.Illegal) { |
142 return "illegal"; | |
143 } else { | |
144 return getKind().format(asBoxedPrimitive()); | |
145 } | |
142 } | 146 } |
143 | 147 |
144 @Override | 148 @Override |
145 public String toString() { | 149 public String toString() { |
146 if (getKind() == Kind.Illegal) { | 150 if (getKind() == Kind.Illegal) { |