Source:
<code>public void execute(String[] args, ConsoleReader reader) throws Exception { String[] newArgs = new String[args.length - 1]; System.arraycopy(args, 1, newArgs, 0, args.length - 1); GetOperatorClassesCommandLineInfo commandLineInfo = getGetOperatorClassesCommandLineInfo(newArgs); String parentName = commandLineInfo.parent != null ? commandLineInfo.parent : DAG.GenericOperator.class.getName(); <START> String files = expandCommaSeparatedFiles(commandLineInfo.args[0]); <END> if (files == null) { throw new CliException("File " + commandLineInfo.args[0] + " is not found"); } String[] jarFiles = files.split(","); File tmpDir = copyToLocal(jarFiles); try { OperatorDiscoverer operatorDiscoverer = new OperatorDiscoverer(jarFiles); String searchTerm = commandLineInfo.args.length > 1 ? commandLineInfo.args[1] : null; Set<String> operatorClasses = operatorDiscoverer.getOperatorClasses(parentName, searchTerm); JSONObject json = new JSONObject(); JSONArray arr = new JSONArray(); JSONObject portClassHier = new JSONObject(); JSONObject portTypesWithSchemaClasses = new JSONObject(); JSONObject failed = new JSONObject(); for (final String clazz : operatorClasses) { try { JSONObject oper = operatorDiscoverer.describeOperator(clazz); operatorDiscoverer.addDefaultValue(clazz, oper); operatorDiscoverer.buildAdditionalPortInfo(oper, portClassHier, portTypesWithSchemaClasses); Iterator portTypesIter = portTypesWithSchemaClasses.keys(); while (portTypesIter.hasNext()) { if (!portTypesWithSchemaClasses.getBoolean((String)portTypesIter.next())) { portTypesIter.remove(); } } arr.put(oper); } catch (Exception | NoClassDefFoundError ex) { final String cls = clazz; failed.put(cls, ex.toString()); } } json.put("operatorClasses", arr); json.put("portClassHier", portClassHier); json.put("portTypesWithSchemaClasses", portTypesWithSchemaClasses); if (failed.length() > 0) { json.put("failedOperators", failed); } printJson(json); } finally { FileUtils.deleteDirectory(tmpDir); } }</code><technical_language>import DAG.GenericOperator, GenericOperator directly</technical_language>

Target:
public void execute(String[] args, ConsoleReader reader) throws Exception { String[] newArgs = new String[args.length - 1]; System.arraycopy(args, 1, newArgs, 0, args.length - 1); GetOperatorClassesCommandLineInfo commandLineInfo = getGetOperatorClassesCommandLineInfo(newArgs); String parentName = commandLineInfo.parent != null ? commandLineInfo.parent : GenericOperator.class.getName(); String files = expandCommaSeparatedFiles(commandLineInfo.args[0]); if (files == null) { throw new CliException("File " + commandLineInfo.args[0] + " is not found"); } String[] jarFiles = files.split(","); File tmpDir = copyToLocal(jarFiles); try { OperatorDiscoverer operatorDiscoverer = new OperatorDiscoverer(jarFiles); String searchTerm = commandLineInfo.args.length > 1 ? commandLineInfo.args[1] : null; Set<String> operatorClasses = operatorDiscoverer.getOperatorClasses(parentName, searchTerm); JSONObject json = new JSONObject(); JSONArray arr = new JSONArray(); JSONObject portClassHier = new JSONObject(); JSONObject portTypesWithSchemaClasses = new JSONObject(); JSONObject failed = new JSONObject(); for (final String clazz : operatorClasses) { try { JSONObject oper = operatorDiscoverer.describeOperator(clazz); operatorDiscoverer.addDefaultValue(clazz, oper); operatorDiscoverer.buildAdditionalPortInfo(oper, portClassHier, portTypesWithSchemaClasses); Iterator portTypesIter = portTypesWithSchemaClasses.keys(); while (portTypesIter.hasNext()) { if (!portTypesWithSchemaClasses.getBoolean((String)portTypesIter.next())) { portTypesIter.remove(); } } arr.put(oper); } catch (Exception | NoClassDefFoundError ex) { final String cls = clazz; failed.put(cls, ex.toString()); } } json.put("operatorClasses", arr); json.put("portClassHier", portClassHier); json.put("portTypesWithSchemaClasses", portTypesWithSchemaClasses); if (failed.length() > 0) { json.put("failedOperators", failed); } printJson(json); } finally { FileUtils.deleteDirectory(tmpDir); } }