final String module = next.substring(next.lastIndexOf('/') + 1,
next.lastIndexOf('.'));
erlModules.add(new OtpErlangString(module));
}
RpcResult res = WranglerBackendManager.getRefactoringBackend().callWithoutParser(
"get_user_refactorings", "x",
new OtpErlangList(erlModules.toArray(new OtpErlangObject[0])));
if (res.isOk() && res.getValue() instanceof OtpErlangList) {
final OtpErlangList genRefac = (OtpErlangList) ((OtpErlangTuple) ((OtpErlangList) res
.getValue()).elementAt(0)).elementAt(1);
final OtpErlangList genCompositeRefac = (OtpErlangList) ((OtpErlangTuple) ((OtpErlangList) res
.getValue()).elementAt(1)).elementAt(1);
for (final OtpErlangObject obj : genRefac) {
elementaryRefacs.add(new UserRefactoringInfo(obj.toString()));
}
for (final OtpErlangObject obj : genCompositeRefac) {
compositeRefacs.add(new UserRefactoringInfo(obj.toString()));
}
}
ErlLogger.info("Refac modules found " + res.toString());
// user's own refactoring
final Enumeration userModules = coreBundle.findEntries(
"wrangler/ebin/my_gen_refac", "*.beam", false);
while (userModules != null && userModules.hasMoreElements()) {
final String next = userModules.nextElement().toString();
myElementaryRefacs.add(new UserRefactoringInfo(next.substring(
next.lastIndexOf('/') + 1, next.lastIndexOf('.'))));
}
// user's own composite refactorings
final Enumeration userCompositeModules = coreBundle.findEntries(
"wrangler/ebin/my_gen_composite_refac", "*.beam", false);
while (userCompositeModules != null && userCompositeModules.hasMoreElements()) {
final String next = userCompositeModules.nextElement().toString();
myCompositeRefacs.add(new UserRefactoringInfo(next.substring(
next.lastIndexOf('/') + 1, next.lastIndexOf('.'))));
}
// load refactorings
res = WranglerBackendManager.getRefactoringBackend().callWithoutParser(
"load_user_refactorings", "s", getEbinPath());
ErlLogger.debug(res.toString());
}