Checker Production   as of Julia version 2.5.0 (built on 4 Jul 2018)

belongs to group Basic

Identify operations that are not adequate for production code


Some operations should not be performed in production code, since they have no effect or have unpredictable effects, or since they might compromise the availability or security of your system.

Action: Verify if the operation is adequate for production code. Remove it or transform it if that is not the case.

Examples


Consider the following program:

import com.juliasoft.julia.extraction.EntryPoint;

public class InadequateCalls {
  public @EntryPoint void check(int k) {
    if (k <= 0)
      System.exit(-1);
    else
      System.out.println(k);
  }
}

This checker issues the following warning:

InadequateCalls.java:6: [Production: InadequateCallInProductionWarning] You should not call java.lang.System.exit(int):void in production code

since calls to System.exit() should not be used in production code, as they would disrupt the availability of your service.

In this example, the programmer should signal the unusual situation in other ways, for instance by throwing an exception or by showing a dialog to the user.