MCPcopy Create free account
hub / github.com/ReadyTalk/avian / matchType

Method matchType

classpath/java/lang/reflect/Field.java:168–200  ·  view source on GitHub ↗
(Object value)

Source from the content-addressed store, hash-verified

166 }
167
168 private boolean matchType(Object value) {
169 switch (vmField.code) {
170 case ByteField:
171 return value instanceof Byte;
172
173 case BooleanField:
174 return value instanceof Boolean;
175
176 case CharField:
177 return value instanceof Character;
178
179 case ShortField:
180 return value instanceof Short;
181
182 case IntField:
183 return value instanceof Integer;
184
185 case LongField:
186 return value instanceof Long;
187
188 case FloatField:
189 return value instanceof Float;
190
191 case DoubleField:
192 return value instanceof Double;
193
194 case ObjectField:
195 return value == null || getType().isInstance(value);
196
197 default:
198 throw new Error();
199 }
200 }
201
202 public void set(Object instance, Object value)
203 throws IllegalAccessException

Callers 1

setMethod · 0.95

Calls 2

getTypeMethod · 0.95
isInstanceMethod · 0.80

Tested by

no test coverage detected