v2/common/src/main/java/com/google/cloud/teleport/v2/transforms/JavascriptTextTransformer.java [267:286]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public String invoke(String data) throws ScriptException, IOException, NoSuchMethodException {
      Invocable invocable = getInvocable();
      if (invocable == null) {
        throw new RuntimeException("No UDF was loaded");
      }

      Object result;
      synchronized (invocable) {
        result = invocable.invokeFunction(functionName(), data);
      }
      if (result == null || ScriptObjectMirror.isUndefined(result)) {
        return null;
      } else if (result instanceof String) {
        return (String) result;
      } else {
        String className = result.getClass().getName();
        throw new RuntimeException(
            "UDF Function did not return a String. Instead got: " + className);
      }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



v1/src/main/java/com/google/cloud/teleport/templates/common/JavascriptTextTransformer.java [255:274]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public String invoke(String data) throws ScriptException, IOException, NoSuchMethodException {
      Invocable invocable = getInvocable();
      if (invocable == null) {
        throw new RuntimeException("No UDF was loaded");
      }

      Object result;
      synchronized (invocable) {
        result = invocable.invokeFunction(functionName(), data);
      }
      if (result == null || ScriptObjectMirror.isUndefined(result)) {
        return null;
      } else if (result instanceof String) {
        return (String) result;
      } else {
        String className = result.getClass().getName();
        throw new RuntimeException(
            "UDF Function did not return a String. Instead got: " + className);
      }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



