MCPcopy Create free account
hub / github.com/FabricMC/Matcher / getClassFileContent

Method getClassFileContent

src/main/java/matcher/srcprocess/Cfr.java:62–85  ·  view source on GitHub ↗
(String path)

Source from the content-addressed store, hash-verified

60 }
61
62 @Override
63 public Pair<byte[], String> getClassFileContent(String path) throws IOException {
64 if (!path.endsWith(fileSuffix)) {
65 Matcher.LOGGER.debug("getClassFileContent invalid path: {}", path);
66 throw new NoSuchFileException(path);
67 }
68
69 String clsName = path.substring(0, path.length() - fileSuffix.length());
70 ClassInstance cls = env.getClsByName(clsName, nameType);
71
72 if (cls == null) {
73 Matcher.LOGGER.debug("getClassFileContent missing cls: {}", clsName);
74 throw new NoSuchFileException(path);
75 }
76
77 if (cls.getAsmNodes() == null) {
78 Matcher.LOGGER.debug("getClassFileContent unknown cls: {}", clsName);
79 throw new NoSuchFileException(path);
80 }
81
82 byte[] data = cls.serialize(nameType);
83
84 return Pair.make(data, path);
85 }
86
87 private final ClassFeatureExtractor env;
88 private final NameType nameType;

Callers

nothing calls this directly

Calls 3

getAsmNodesMethod · 0.95
serializeMethod · 0.95
getClsByNameMethod · 0.65

Tested by

no test coverage detected