Configure a runtime component. Catch {@link RuntimeException} and
re-throw with a Flink internal exception which is processed by
CliFrontend for display to the user.

@param parameterized the component to be configured
770561
private void parameterize(Parameterized parameterized) {
		try {
			parameterized.configure(parameters);
		} catch (RuntimeException ex) {
			throw new ProgramParametrizationException(ex.getMessage());
		}
	}
117785
protected RuntimeException runtimeException(final Exception exception) {
        if (exception instanceof RuntimeException) {
            throw (RuntimeException) exception;
        } else {
            throw new RuntimeException(exception);
        }
    }
456689
protected void reportErrors(Parameterization config) {
    StringBuilder buf = new StringBuilder();
    for(ParameterException e : config.getErrors()) {
      if(e instanceof UnspecifiedParameterException) {
        continue;
      }
      buf.append(e.getMessage()).append(FormatUtil.NEWLINE);
    }
    if(buf.length() > 0) {
      LOG.warning("Configuration errors:" + FormatUtil.NEWLINE + FormatUtil.NEWLINE + buf.toString());
    }
    // config.clearErrors();
  }
620357
public static void setRuntimeProperty(Object key, Object value) {

        OpenCmsCore.getInstance().setRuntimeProperty(key, value);
    }
1192543
public RetryerBuilder<V> retryIfRuntimeException() {
        rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(RuntimeException.class));
        return this;
    }
926096
public void define(final ParameterItem<?> key, final Object forcedValue) {
        this.overriddenParametersMap.put(key, forcedValue);
        set(getParamKey(key), forcedValue);
    }
718398
@Override
    public void setTraversableResolver(Configuration<?> apiConfig) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "setTraversableResolver", apiConfig);
        }
        Class<? extends TraversableResolver> clazz = null;
        TraversableResolver tr = null;
        if (traversableResolver != null) {
            try {
                clazz = loadClass(traversableResolver).asSubclass(TraversableResolver.class);
                tr = instantiateClass(clazz);
            } catch (Throwable t) {
                FFDCFilter.processException(t, CLASS_NAME + ".setTraversableResolver", "280");

                // message and exception printed out in previous method called.
                // however since we can not create a validation factory throw validationException
                ValidationException e = new ValidationException(t);
                throw e;
            }
        }

        if (tr != null) {
            apiConfig.traversableResolver(tr);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "setTraversableResolver", tr);
        }
    }
404137
protected static <U> U checkedCall(Callable<U> callable) {
        try {
            return callable.call();
        } catch (Throwable ex) {
            if (ex instanceof RuntimeException) {
                throw (RuntimeException)ex;
            }
            if (ex instanceof Error) {
                throw (Error)ex;
            }
            throw new RuntimeException(ex);
        }
    }
1243933
public static RuntimeException wrapRuntime(Throwable throwable) {
		if (throwable instanceof RuntimeException) {
			return (RuntimeException) throwable;
		}
		if (throwable instanceof Error) {
			throw (Error) throwable;
		}
		return new RuntimeException(throwable);
	}
1234157
public void setParameters(Parameterization config) {
    TrackParameters track = new TrackParameters(config);
    configureStep(track);

    // update parameter table
    {
      parameterTable.setEnabled(false);

      parameterTable.clear();
      for(TrackedParameter pair : track.getAllParameters()) {
        parameterTable.addParameter(pair.getOwner(), pair.getParameter(), track);
      }
      // parameters.updateFromTrackParameters(track);

      parameterTable.revalidate();
      parameterTable.setEnabled(true);
    }

    // Update status and notify observers
    updateStatus();
    firePanelUpdated();
  }
267071
public static void runCLIApplication(Class<?> cls, String[] args) {
    SerializedParameterization params = new SerializedParameterization(args);
    Flag helpF = new Flag(Parameterizer.HELP_ID);
    params.grab(helpF);
    Flag helpLongF = new Flag(Parameterizer.HELP_LONG_ID);
    params.grab(helpLongF);
    try {
      ClassParameter<Object> descriptionP = new ClassParameter<>(Parameterizer.DESCRIPTION_ID, Object.class, true);
      params.grab(descriptionP);
      if(descriptionP.isDefined()) {
        params.clearErrors();
        printDescription(descriptionP.getValue());
        System.exit(1);
      }
      // Parse debug parameter
      StringParameter debugP = new StringParameter(Parameterizer.DEBUG_ID).setOptional(true);
      params.grab(debugP);
      if(debugP.isDefined()) {
        Parameterizer.parseDebugParameter(debugP);
      }
      // Fail silently on errors.
      if(params.getErrors().size() > 0) {
        params.logAndClearReportedErrors();
        System.exit(1);
      }
    }
    catch(Exception e) {
      printErrorMessage(e);
      System.exit(1);
    }
    try {
      TrackParameters config = new TrackParameters(params);
      Flag verboseF = new Flag(Parameterizer.VERBOSE_ID);
      if(config.grab(verboseF) && verboseF.isTrue()) {
        // Extra verbosity by repeating the flag:
        Flag verbose2F = new Flag(Parameterizer.VERBOSE_ID);
        LoggingConfiguration.setVerbose((config.grab(verbose2F) && verbose2F.isTrue()) ? Level.VERYVERBOSE : Level.VERBOSE);
      }
      AbstractApplication task = ClassGenericsUtil.tryInstantiate(AbstractApplication.class, cls, config);

      if((helpF.isDefined() && helpF.getValue()) || (helpLongF.isDefined() && helpLongF.getValue())) {
        LoggingConfiguration.setVerbose(Level.VERBOSE);
        LOG.verbose(usage(config.getAllParameters()));
        System.exit(1);
      }
      if(params.getErrors().size() > 0) {
        LoggingConfiguration.setVerbose(Level.VERBOSE);
        LOG.verbose("ERROR: The following configuration errors prevented execution:");
        for(ParameterException e : params.getErrors()) {
          LOG.verbose(e.getMessage() + "\n");
        }
        params.logUnusedParameters();
        LOG.verbose("Stopping execution because of configuration errors above.");
        System.exit(1);
      }
      params.logUnusedParameters();
      task.run();
    }
    catch(Exception e) {
      printErrorMessage(e);
    }
  }
140237
@Override
    public void setParameter(Map<String, String> paraMap) {
        if (paraMap.containsKey("k")) {
            this.k = Integer.parseInt(paraMap.get("k"));
        }
        if (paraMap.containsKey("mode")) {
            this.mode = Integer.parseInt(paraMap.get("mode"));
        }
    }
1060734
public static void validateNestedParameterizedType(Type parameterType) {
    if (isParameterized(parameterType)
        || GenericArrayType.class.isAssignableFrom(parameterType.getClass())) {
      throw new IllegalArgumentException(
          "Invalid field. Cannot marshal fields of type Collection<GenericType> or GenericType[].");
    }
  }
1147992
@Override
  public Void visitParameterizedType(ParameterizedTypeTree tree, VisitorState visitorState) {
    VisitorState state =
        processMatchers(
            parameterizedTypeMatchers,
            tree,
            ParameterizedTypeTreeMatcher::matchParameterizedType,
            visitorState);
    return super.visitParameterizedType(tree, state);
  }
520486
public static <T> Callable<T> callable(CheckedCallable<T> callable) {
        return callable(callable, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
4100
public void setXmlConfigured( final File xmlConfigured )
    {
        try
        {
            final String path = xmlConfigured.getCanonicalPath();
            if ( !xmlConfigured.exists() )
            {
                getLog().warn( "xmlConfigured parameter invalid. [" + path + "] does not exist." );
            }
            else if ( !path.trim().toLowerCase().endsWith( ".xml" ) )
            {
                getLog().warn( "xmlConfigured parameter invalid. XML file name must end in .xml" );
            }
            else
            {
                this.xmlConfigured = xmlConfigured;
            }
        }
        catch ( Exception e )
        {
            getLog().error( "Exception setting xmlConfigured option", e );
        }
    }
101964
@Override
	@SuppressWarnings({ "rawtypes" })
	public void accept(final TransformContext transformContext) {
		Object var = eval(transformContext);

		if (var == null) {
			throw new ParameterNotFoundRuntimeException("Parameter is not set. [" + expression + "]");
		} else if (var instanceof List) {
			bindArray(transformContext, ((List) var).toArray());
		} else if (var.getClass().isArray()) {
			bindArray(transformContext, var);
		} else {
			bindArray(transformContext, new Object[] { var });
		}
		pass();
	}