runtime/java/v11/lib/src/Launcher.java [139:202]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                if (element.isJsonObject()) {
                    // collect payload and environment
                    for (Map.Entry<String, JsonElement> entry : element.getAsJsonObject().entrySet()) {
                        if (entry.getKey().equals("value")) {
                            if (entry.getValue().isJsonObject())
                                payloadForJsonObject = entry.getValue().getAsJsonObject();
                            else {
                                payloadForJsonArray = entry.getValue().getAsJsonArray();
                                isJsonObjectParam = false;
                            }
                        } else {
                            env.put(String.format("__OW_%s", entry.getKey().toUpperCase()),
                                    entry.getValue().getAsString());
                        }
                    }
                    augmentEnv(env);
                }

                Method m = null;
                if (isJsonObjectParam) {
                    m = mainClass.getMethod(mainMethodName, new Class[] { JsonObject.class });
                } else {
                    m = mainClass.getMethod(mainMethodName, new Class[] { JsonArray.class });
                }
                m.setAccessible(true);
                int modifiers = m.getModifiers();
                if ((m.getReturnType() != JsonObject.class && m.getReturnType() != JsonArray.class) || !Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers)) {
                    throw new NoSuchMethodException(mainMethodName);
                }
                mainMethod = m;

                Object response;
                if (isJsonObjectParam) {
                    response = invokeMain(payloadForJsonObject, env);
                } else {
                    response = invokeMain(payloadForJsonArray, env);
                }
                out.println(response.toString());
            } catch(NullPointerException npe) {
                System.out.println("the action returned null");
                npe.printStackTrace(System.err);
                JsonObject error = new JsonObject();
                error.addProperty("error", "the action returned null");
                out.println(error.toString());
                out.flush();
            } catch(InvocationTargetException ite) {
                Throwable ex = ite;
                if(ite.getCause() != null)
                    ex = ite.getCause();
                ex.printStackTrace(System.err);
                JsonObject error = new JsonObject();
                error.addProperty("error", ex.getMessage());
                out.println(error.toString());
                out.flush();
            } catch (Exception ex) {
                ex.printStackTrace(System.err);
                JsonObject error = new JsonObject();
                error.addProperty("error", ex.getMessage());
                out.println(error.toString());
                out.flush();
            }
            out.flush();
            System.out.flush();
            System.err.flush();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



runtime/java/v17/lib/src/Launcher.java [145:208]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                 if (element.isJsonObject()) {
                     // collect payload and environment
                     for (Map.Entry<String, JsonElement> entry : element.getAsJsonObject().entrySet()) {
                         if (entry.getKey().equals("value")) {
                             if (entry.getValue().isJsonObject())
                                 payloadForJsonObject = entry.getValue().getAsJsonObject();
                             else {
                                 payloadForJsonArray = entry.getValue().getAsJsonArray();
                                 isJsonObjectParam = false;
                             }
                         } else {
                             env.put(String.format("__OW_%s", entry.getKey().toUpperCase()),
                                     entry.getValue().getAsString());
                         }
                     }
                     augmentEnv(env);
                 }

                 Method m = null;
                 if (isJsonObjectParam) {
                     m = mainClass.getMethod(mainMethodName, new Class[] { JsonObject.class });
                 } else {
                     m = mainClass.getMethod(mainMethodName, new Class[] { JsonArray.class });
                 }
                 m.setAccessible(true);
                 int modifiers = m.getModifiers();
                 if ((m.getReturnType() != JsonObject.class && m.getReturnType() != JsonArray.class) || !Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers)) {
                     throw new NoSuchMethodException(mainMethodName);
                 }
                 mainMethod = m;

                 Object response;
                 if (isJsonObjectParam) {
                     response = invokeMain(payloadForJsonObject, env);
                 } else {
                     response = invokeMain(payloadForJsonArray, env);
                 }
                 out.println(response.toString());
             } catch(NullPointerException npe) {
                 System.out.println("the action returned null");
                 npe.printStackTrace(System.err);
                 JsonObject error = new JsonObject();
                 error.addProperty("error", "the action returned null");
                 out.println(error.toString());
                 out.flush();
             } catch(InvocationTargetException ite) {
                 Throwable ex = ite;
                 if(ite.getCause() != null)
                     ex = ite.getCause();
                 ex.printStackTrace(System.err);
                 JsonObject error = new JsonObject();
                 error.addProperty("error", ex.getMessage());
                 out.println(error.toString());
                 out.flush();
             } catch (Exception ex) {
                 ex.printStackTrace(System.err);
                 JsonObject error = new JsonObject();
                 error.addProperty("error", ex.getMessage());
                 out.println(error.toString());
                 out.flush();
             }
             out.flush();
             System.out.flush();
             System.err.flush();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



