Repository: GoogleContainerTools/jib
File: jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/ContainerParameters.java (Java)

Code before:

  @Input
  @Optional
  public List<String> getExtraClasspath() {
    if (System.getProperty(PropertyNames.CONTAINER_EXTRA_CLASSPATH) != null) {
      return ConfigurationPropertyValidator.parseListProperty(
          System.getProperty(PropertyNames.CONTAINER_EXTRA_CLASSPATH));
    }
    return extraClasspath;
  }

  public void setExtraClasspath(List<String> classpath) {
    extraClasspath = classpath;
  }

  @Input
  public boolean getExpandClasspathDependencies() {
    if (System.getProperty(PropertyNames.EXPAND_CLASSPATH_DEPENDENCIES) != null) {
      return Boolean.valueOf(System.getProperty(PropertyNames.EXPAND_CLASSPATH_DEPENDENCIES));
    }
    return expandClasspathDependencies;
  }

  public void setExpandClasspathDependencies(boolean expand) {
    expandClasspathDependencies = expand;
  }

  @Input
  @Optional
  public Property<String> getMainClass() {
    String mainClassProperty = System.getProperty(PropertyNames.CONTAINER_MAIN_CLASS);
    if (mainClassProperty != null && !mainClassProperty.equals(mainClass.getOrNull())) {
      mainClass.set(mainClassProperty);
    }
    return mainClass;
  }

  @Input
  @Nullable
  @Optional
  public List<String> getArgs() {
    if (System.getProperty(PropertyNames.CONTAINER_ARGS) != null) {
      return ConfigurationPropertyValidator.parseListProperty(
          System.getProperty(PropertyNames.CONTAINER_ARGS));
    }
    return args;
  }

  public void setArgs(List<String> args) {
    this.args = args;
  }

Review comment (security):
Because `mainClass` was previously nullable, I wonder if we should keep a `Nullable`-annotated getter for it out of consideration for backward compatibility? (Perhaps something similar to when `from.auth.username` and `from.auth.password` were converted for lazy eval)  

https://github.com/GoogleContainerTools/jib/blob/fa8cc958f4ddad55a9eba043fdfd7c32eddb49b6/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/AuthParameters.java#L50-L52


Code after:
  }

  public void setEnvironment(Map<String, String> environment) {
    this.environment = environment;
  }

  @Input
  @Optional
  public List<String> getExtraClasspath() {
    if (System.getProperty(PropertyNames.CONTAINER_EXTRA_CLASSPATH) != null) {
      return ConfigurationPropertyValidator.parseListProperty(
          System.getProperty(PropertyNames.CONTAINER_EXTRA_CLASSPATH));
    }
    return extraClasspath;
  }

  public void setExtraClasspath(List<String> classpath) {
    extraClasspath = classpath;
  }

  @Input
  public boolean getExpandClasspathDependencies() {
    if (System.getProperty(PropertyNames.EXPAND_CLASSPATH_DEPENDENCIES) != null) {
      return Boolean.valueOf(System.getProperty(PropertyNames.EXPAND_CLASSPATH_DEPENDENCIES));
    }
    return expandClasspathDependencies;
  }

  public void setExpandClasspathDependencies(boolean expand) {
    expandClasspathDependencies = expand;
  }

  @Input
  @Nullable
  @Optional
  public String getMainClass() {
    String mainClassProperty = System.getProperty(PropertyNames.CONTAINER_MAIN_CLASS);
    if (mainClassProperty != null) {
      return mainClassProperty;
    }
    return mainClass.getOrNull();
  }

  public void setMainClass(String mainClass) {
    this.mainClass.set(mainClass);
  }

  public void setMainClass(Provider<String> mainClass) {
    this.mainClass.set(mainClass);
  }