MCPcopy
hub / github.com/Col-E/Recaf / isValidClass

Method isValidClass

src/main/java/me/coley/recaf/util/ClassUtil.java:412–421  ·  view source on GitHub ↗

Validate the class can be parsed by ASM. @param value Class bytecode. @return true when the class can be read by ASM.

(byte[] value)

Source from the content-addressed store, hash-verified

410 * @return {@code true} when the class can be read by ASM.
411 */
412 public static boolean isValidClass(byte[] value) {
413 if (!isClass(value))
414 return false;
415 try {
416 getNode(new ClassReader(value), SKIP_FRAMES);
417 return true;
418 } catch(Throwable t) {
419 return false;
420 }
421 }
422
423}

Callers 3

onClassMethod · 0.95
handleAddClassMethod · 0.95
finishClassesMethod · 0.95

Calls 2

isClassMethod · 0.95
getNodeMethod · 0.95

Tested by

no test coverage detected