Code example for AtomicReference

Methods: getAndSet

        return null; 
    private static void setInstance(CommandLine commandLine) {
        CommandLine oldCommandLine = sCommandLine.getAndSet(commandLine);
        if (oldCommandLine != null && oldCommandLine.isNativeImplementation()) {
     * @param fileName the file to read in. 
     * @param sizeLimit cap on the file size: will throw an exception if exceeded 
     * @return Array of chars read from the file 
     * @throws FileNotFoundException file does not exceed 
     * @throws IOException error encountered accessing the file 
    private static char[] readUtf8FileFully(String fileName, int sizeLimit) throws
            FileNotFoundException, IOException {