MCPcopy Index your code
hub / github.com/beanshell/beanshell / getIndex

Method getIndex

src/bsh/Reflect.java:173–185  ·  view source on GitHub ↗
(Object array, int index)

Source from the content-addressed store, hash-verified

171
172
173 public static Object getIndex(Object array, int index) throws ReflectError, UtilTargetError {
174 if (Interpreter.DEBUG) {
175 Interpreter.debug("getIndex: " + array + ", index=" + index);
176 }
177 try {
178 Object val = Array.get(array, index);
179 return Primitive.wrap(val, array.getClass().getComponentType());
180 } catch (ArrayIndexOutOfBoundsException e1) {
181 throw new UtilTargetError(e1);
182 } catch (Exception e) {
183 throw new ReflectError("Array access:" + e);
184 }
185 }
186
187
188 public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError {

Callers 2

getValueMethod · 0.95
doIndexMethod · 0.95

Calls 4

debugMethod · 0.95
wrapMethod · 0.95
getClassMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected