Commits

Anonymous committed bb71f88

Formatting only (preparatory to JLine changes)
Tabs to whitespace, curly brackets, @Override, import list order, line-wraps, spellings, etc.
in files I expect to touch.

Comments (0)

Files changed (4)

src/org/python/core/PySystemState.java

 import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Set;
 import java.util.StringTokenizer;
-import java.util.Map.Entry;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ConcurrentMap;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 
 import jnr.posix.util.Platform;
+
 import org.python.Version;
 import org.python.core.adapter.ClassicPyObjectAdapter;
 import org.python.core.adapter.ExtensiblePyObjectAdapter;
 import org.python.core.packagecache.PackageManager;
 import org.python.core.packagecache.SysPackageManager;
+import org.python.expose.ExposedGet;
+import org.python.expose.ExposedType;
 import org.python.modules.Setup;
 import org.python.modules.zipimport.zipimporter;
 import org.python.util.Generic;
-import org.python.expose.ExposedGet;
-import org.python.expose.ExposedType;
 
 /**
  * The "sys" module.
 // xxx Many have lamented, this should really be a module!
 // but it will require some refactoring to see this wish come true.
 public class PySystemState extends PyObject implements ClassDictInit {
+
     public static final String PYTHON_CACHEDIR = "python.cachedir";
     public static final String PYTHON_CACHEDIR_SKIP = "python.cachedir.skip";
     public static final String PYTHON_CONSOLE_ENCODING = "python.console.encoding";
 
     public static final PyString version = new PyString(Version.getVersion());
 
-    public static final PyTuple subversion = new PyTuple(new PyString("Jython"),
-                                                         Py.newString(""),
-                                                         Py.newString(""));
+    public static final PyTuple subversion = new PyTuple(new PyString("Jython"), Py.newString(""),
+            Py.newString(""));
 
-    public static final int hexversion = ((Version.PY_MAJOR_VERSION << 24) |
-                                    (Version.PY_MINOR_VERSION << 16) |
-                                    (Version.PY_MICRO_VERSION <<  8) |
-                                    (Version.PY_RELEASE_LEVEL <<  4) |
-                                    (Version.PY_RELEASE_SERIAL << 0));
+    public static final int hexversion = ((Version.PY_MAJOR_VERSION << 24)
+            | (Version.PY_MINOR_VERSION << 16) | (Version.PY_MICRO_VERSION << 8)
+            | (Version.PY_RELEASE_LEVEL << 4) | (Version.PY_RELEASE_SERIAL << 0));
 
     public static PyTuple version_info;
 
     public final static int maxunicode = 1114111;
 
-    //XXX: we should someday make this Long.MAX_VALUE, but see test_index.py
-    //     for tests that would need to pass but today would not.
+    // XXX: we should someday make this Long.MAX_VALUE, but see test_index.py
+    // for tests that would need to pass but today would not.
     public final static int maxsize = Integer.MAX_VALUE;
 
     public final static PyString float_repr_style = Py.newString("short");
     public static boolean py3kwarning = false;
 
     public final static Class flags = Options.class;
-    
+
     public static PyTuple _mercurial;
     /**
      * The copyright notice for this release.
      */
 
-    public static final PyObject copyright = Py.newString(
-        "Copyright (c) 2000-2013 Jython Developers.\n" +
-        "All rights reserved.\n\n" +
+    public static final PyObject copyright = Py
+            .newString("Copyright (c) 2000-2013 Jython Developers.\n" + "All rights reserved.\n\n" +
 
-        "Copyright (c) 2000 BeOpen.com.\n" +
-        "All Rights Reserved.\n\n"+
+            "Copyright (c) 2000 BeOpen.com.\n" + "All Rights Reserved.\n\n" +
 
-        "Copyright (c) 2000 The Apache Software Foundation.\n" +
-        "All rights reserved.\n\n" +
+            "Copyright (c) 2000 The Apache Software Foundation.\n" + "All rights reserved.\n\n" +
 
-        "Copyright (c) 1995-2000 Corporation for National Research "+
-        "Initiatives.\n" +
-        "All Rights Reserved.\n\n" +
+            "Copyright (c) 1995-2000 Corporation for National Research " + "Initiatives.\n"
+                    + "All Rights Reserved.\n\n" +
 
-        "Copyright (c) 1991-1995 Stichting Mathematisch Centrum, " +
-        "Amsterdam.\n" +
-        "All Rights Reserved.");
+                    "Copyright (c) 1991-1995 Stichting Mathematisch Centrum, " + "Amsterdam.\n"
+                    + "All Rights Reserved.");
 
-    private static Map<String,String> builtinNames;
+    private static Map<String, String> builtinNames;
     public static PyTuple builtin_module_names = null;
 
     public static PackageManager packageManager;
     private final PySystemStateCloser closer;
     private static final ReferenceQueue<PySystemState> systemStateQueue =
             new ReferenceQueue<PySystemState>();
-    private static final ConcurrentMap<WeakReference<PySystemState>,
-                                       PySystemStateCloser> sysClosers = Generic.concurrentMap();
+    private static final ConcurrentMap<WeakReference<PySystemState>, PySystemStateCloser> sysClosers =
+            Generic.concurrentMap();
 
     // float_info
     public static PyObject float_info;
     }
 
     private static void checkReadOnly(String name) {
-        if (name == "__dict__" ||
-            name == "__class__" ||
-            name == "registry" ||
-            name == "exec_prefix" ||
-            name == "packageManager") {
+        if (name == "__dict__" || name == "__class__" || name == "registry"
+                || name == "exec_prefix" || name == "packageManager") {
             throw Py.TypeError("readonly attribute");
         }
     }
 
     private static void checkMustExist(String name) {
-        if (name == "__dict__" ||
-            name == "__class__" ||
-            name == "registry" ||
-            name == "exec_prefix" ||
-            name == "platform" ||
-            name == "packageManager" ||
-            name == "builtins" ||
-            name == "warnoptions") {
+        if (name == "__dict__" || name == "__class__" || name == "registry"
+                || name == "exec_prefix" || name == "platform" || name == "packageManager"
+                || name == "builtins" || name == "warnoptions") {
             throw Py.TypeError("readonly attribute");
         }
     }
         }
 
         for (PyFile stdStream : new PyFile[] {(PyFile)this.stdin, (PyFile)this.stdout,
-                                              (PyFile)this.stderr}) {
+                (PyFile)this.stderr}) {
             if (stdStream.isatty()) {
                 stdStream.encoding = encoding;
             }
     // might be nice to have something general here, but for now these
     // seem to be the only values that need to be explicitly shadowed
     private Shadow shadowing;
+
     public synchronized void shadow() {
         if (shadowing == null) {
             shadowing = new Shadow();
     }
 
     private static class DefaultBuiltinsHolder {
+
         static final PyObject builtins = fillin();
 
         static PyObject fillin() {
     }
 
     // xxx fix this accessors
+    @Override
     public PyObject __findattr_ex__(String name) {
         if (name == "exc_value") {
             PyException exc = Py.getThreadState().exception;
         }
     }
 
+    @Override
     public void __setattr__(String name, PyObject value) {
         checkReadOnly(name);
         if (name == "builtins") {
         }
     }
 
+    @Override
     public void __delattr__(String name) {
         checkMustExist(name);
         PyObject ret = getType().lookup(name); // xxx fix fix fix
     }
 
     // xxx
+    @Override
     public void __rawdir__(PyDictionary accum) {
         accum.update(__dict__);
     }
 
+    @Override
     public String toString() {
         return "<module '" + __name__ + "' (built-in)>";
     }
     }
 
     public void setrecursionlimit(int recursionlimit) {
-        if(recursionlimit <= 0) {
+        if (recursionlimit <= 0) {
             throw Py.ValueError("Recursion limit must be positive");
         }
         this.recursionlimit = recursionlimit;
     /**
      * Change the current working directory to the specified path.
      *
-     * path is assumed to be absolute and canonical (via
-     * os.path.realpath).
+     * path is assumed to be absolute and canonical (via os.path.realpath).
      *
      * @param path a path String
      */
     }
 
     /**
-     * Resolve a path. Returns the full path taking the current
-     * working directory into account.
+     * Resolve a path. Returns the full path taking the current working directory into account.
      *
      * @param path a path String
      * @return a resolved path String
     }
 
     /**
-     * Resolve a path. Returns the full path taking the current
-     * working directory into account.
+     * Resolve a path. Returns the full path taking the current working directory into account.
      *
-     * Like getPath but called statically. The current PySystemState
-     * is only consulted for the current working directory when it's
-     * necessary (when the path is relative).
+     * Like getPath but called statically. The current PySystemState is only consulted for the
+     * current working directory when it's necessary (when the path is relative).
      *
      * @param path a path String
      * @return a resolved path String
         File file = new File(path);
         // Python considers r'\Jython25' and '/Jython25' abspaths on Windows, unlike
         // java.io.File
-        if (!file.isAbsolute() && (!Platform.IS_WINDOWS
-                                   || !(path.startsWith("\\") || path.startsWith("/")))) {
+        if (!file.isAbsolute()
+                && (!Platform.IS_WINDOWS || !(path.startsWith("\\") || path.startsWith("/")))) {
             if (sys == null) {
                 sys = Py.getSystemState();
             }
                 exitfunc.__call__();
             } catch (PyException exc) {
                 if (!exc.match(Py.SystemExit)) {
-                    Py.println(stderr,
-                               Py.newString("Error in sys.exitfunc:"));
+                    Py.println(stderr, Py.newString("Error in sys.exitfunc:"));
                 }
                 Py.printException(exc);
             }
         this.classLoader = classLoader;
     }
 
-    private static String findRoot(Properties preProperties,
-                                     Properties postProperties,
-                                     String jarFileName)
-    {
+    private static String findRoot(Properties preProperties, Properties postProperties,
+            String jarFileName) {
         String root = null;
         try {
-            if (postProperties != null)
+            if (postProperties != null) {
                 root = postProperties.getProperty("python.home");
-            if (root == null)
+            }
+            if (root == null) {
                 root = preProperties.getProperty("python.home");
-            if (root == null)
+            }
+            if (root == null) {
                 root = preProperties.getProperty("install.root");
+            }
 
             determinePlatform(preProperties);
         } catch (Exception exc) {
     }
 
     private static void initRegistry(Properties preProperties, Properties postProperties,
-                                       boolean standalone, String jarFileName)
-    {
+            boolean standalone, String jarFileName) {
         if (registry != null) {
             Py.writeError("systemState", "trying to reinitialize registry");
             return;
                 addRegistryFile(homeFile);
                 addRegistryFile(new File(prefix, "registry"));
             } catch (Exception exc) {
+                // Continue
             }
         }
         if (prefix != null) {
                 registry.setProperty("python.path", jythonpath);
             }
         } catch (SecurityException e) {
+            // Continue
         }
         registry.putAll(postProperties);
         if (standalone) {
         // Set up options from registry
         Options.setFromRegistry();
     }
-    
+
     /**
      * @return the encoding of the underlying platform; can be <code>null</code>
      */
         }
         return encoding;
     }
-    
+
     private static void addRegistryFile(File file) {
         if (file.exists()) {
             if (!file.isDirectory()) {
         initialize(preProperties, postProperties, new String[] {""});
     }
 
-    public static synchronized void initialize(Properties preProperties,
-                                               Properties postProperties,
-                                               String[] argv) {
+    public static synchronized void initialize(Properties preProperties, Properties postProperties,
+            String[] argv) {
         initialize(preProperties, postProperties, argv, null);
     }
 
-    public static synchronized void initialize(Properties preProperties,
-                                               Properties postProperties,
-                                               String[] argv,
-                                               ClassLoader classLoader) {
+    public static synchronized void initialize(Properties preProperties, Properties postProperties,
+            String[] argv, ClassLoader classLoader) {
         initialize(preProperties, postProperties, argv, classLoader, new ClassicPyObjectAdapter());
     }
 
-    public static synchronized void initialize(Properties preProperties,
-                                               Properties postProperties,
-                                               String[] argv,
-                                               ClassLoader classLoader,
-                                               ExtensiblePyObjectAdapter adapter) {
+    public static synchronized void initialize(Properties preProperties, Properties postProperties,
+            String[] argv, ClassLoader classLoader, ExtensiblePyObjectAdapter adapter) {
         if (initialized) {
             return;
         }
             }
             ClassLoader sysStateLoader = PySystemState.class.getClassLoader();
             if (sysStateLoader != null) {
-                if (initialize(preProperties,
-                               postProperties,
-                               argv,
-                               classLoader,
-                               adapter,
-                               sysStateLoader)) {
+                if (initialize(preProperties, postProperties, argv, classLoader, adapter,
+                        sysStateLoader)) {
                     return;
                 }
             } else {
                 Py.writeDebug("initializer", "PySystemState.class class loader null, skipping");
             }
         } catch (UnsupportedCharsetException e) {
-            Py.writeWarning("initializer", "Unable to load the UTF-8 charset to read an initializer definition");
+            Py.writeWarning("initializer",
+                    "Unable to load the UTF-8 charset to read an initializer definition");
             e.printStackTrace(System.err);
         } catch (SecurityException e) {
             // Must be running in a security environment that doesn't allow access to the class
             // loader
         } catch (Exception e) {
             Py.writeWarning("initializer",
-                            "Unexpected exception thrown while trying to use initializer service");
+                    "Unexpected exception thrown while trying to use initializer service");
             e.printStackTrace(System.err);
         }
         doInitialize(preProperties, postProperties, argv, classLoader, adapter);
     }
 
     private static final String INITIALIZER_SERVICE =
-        "META-INF/services/org.python.core.JythonInitializer";
+            "META-INF/services/org.python.core.JythonInitializer";
 
     /**
-     * Attempts to read a SystemStateInitializer service from the given classloader, instantiate it,
-     * and initialize with it.
+     * Attempts to read a SystemStateInitializer service from the given class loader, instantiate
+     * it, and initialize with it.
      *
-     * @throws UnsupportedCharsetException
-     *             if unable to load UTF-8 to read a service definition
+     * @throws UnsupportedCharsetException if unable to load UTF-8 to read a service definition
      * @return true if a service is found and successfully initializes.
      */
-    private static boolean initialize(Properties pre,
-                                      Properties post,
-                                      String[] argv,
-                                      ClassLoader sysClassLoader,
-                                      ExtensiblePyObjectAdapter adapter,
-                                      ClassLoader initializerClassLoader) {
+    private static boolean initialize(Properties pre, Properties post, String[] argv,
+            ClassLoader sysClassLoader, ExtensiblePyObjectAdapter adapter,
+            ClassLoader initializerClassLoader) {
         InputStream in = initializerClassLoader.getResourceAsStream(INITIALIZER_SERVICE);
         if (in == null) {
-            Py.writeDebug("initializer", "'" + INITIALIZER_SERVICE + "' not found on " + initializerClassLoader);
+            Py.writeDebug("initializer", "'" + INITIALIZER_SERVICE + "' not found on "
+                    + initializerClassLoader);
             return false;
         }
         BufferedReader r = new BufferedReader(new InputStreamReader(in, Charset.forName("UTF-8")));
             return false;
         }
         try {
-            ((JythonInitializer)initializer.newInstance()).initialize(pre,
-                                                                      post,
-                                                                      argv,
-                                                                      sysClassLoader,
-                                                                      adapter);
+            ((JythonInitializer)initializer.newInstance()).initialize(pre, post, argv,
+                    sysClassLoader, adapter);
         } catch (Exception e) {
             Py.writeWarning("initializer", "Failed initializing with class '" + className
                     + "', continuing");
         return initialized;
     }
 
-
     public static synchronized PySystemState doInitialize(Properties preProperties,
-                                                 Properties postProperties,
-                                                 String[] argv,
-                                                 ClassLoader classLoader,
-                                                 ExtensiblePyObjectAdapter adapter) {
+            Properties postProperties, String[] argv, ClassLoader classLoader,
+            ExtensiblePyObjectAdapter adapter) {
         if (initialized) {
             return Py.defaultSystemState;
         }
         Py.stdout = new StdoutWrapper();
 
         String s;
-        if(Version.PY_RELEASE_LEVEL == 0x0A)
+        if (Version.PY_RELEASE_LEVEL == 0x0A) {
             s = "alpha";
-        else if(Version.PY_RELEASE_LEVEL == 0x0B)
+        } else if (Version.PY_RELEASE_LEVEL == 0x0B) {
             s = "beta";
-        else if(Version.PY_RELEASE_LEVEL == 0x0C)
+        } else if (Version.PY_RELEASE_LEVEL == 0x0C) {
             s = "candidate";
-        else if(Version.PY_RELEASE_LEVEL == 0x0F)
+        } else if (Version.PY_RELEASE_LEVEL == 0x0F) {
             s = "final";
-        else if(Version.PY_RELEASE_LEVEL == 0xAA)
+        } else if (Version.PY_RELEASE_LEVEL == 0xAA) {
             s = "snapshot";
-        else
-            throw new RuntimeException("Illegal value for PY_RELEASE_LEVEL: " +
-                                       Version.PY_RELEASE_LEVEL);
-        version_info = new PyTuple(Py.newInteger(Version.PY_MAJOR_VERSION),
-                                   Py.newInteger(Version.PY_MINOR_VERSION),
-                                   Py.newInteger(Version.PY_MICRO_VERSION),
-                                   Py.newString(s),
-                                   Py.newInteger(Version.PY_RELEASE_SERIAL));
-        _mercurial = new PyTuple(Py.newString("Jython"), Py.newString(Version.getHGIdentifier()),
-                                 Py.newString(Version.getHGVersion()));
+        } else {
+            throw new RuntimeException("Illegal value for PY_RELEASE_LEVEL: "
+                    + Version.PY_RELEASE_LEVEL);
+        }
+        version_info =
+                new PyTuple(Py.newInteger(Version.PY_MAJOR_VERSION),
+                        Py.newInteger(Version.PY_MINOR_VERSION),
+                        Py.newInteger(Version.PY_MICRO_VERSION), Py.newString(s),
+                        Py.newInteger(Version.PY_RELEASE_SERIAL));
+        _mercurial =
+                new PyTuple(Py.newString("Jython"), Py.newString(Version.getHGIdentifier()),
+                        Py.newString(Version.getHGVersion()));
 
         float_info = FloatInfo.getInfo();
         long_info = LongInfo.getInfo();
     }
 
-
     public static boolean isPackageCacheEnabled() {
         return cachedir != null;
     }
     }
 
     /**
-     * Determine the default sys.executable value from the
-     * registry. Returns Py.None is no executable can be found.
+     * Determine the default sys.executable value from the registry. Returns Py.None is no
+     * executable can be found.
      *
      * @param props a Properties registry
      * @return a PyObject path string or Py.None
         if (colon != -1) {
             // name:fqclassname
             modname = name.substring(0, colon).trim();
-            classname = name.substring(colon+1, name.length()).trim();
-            if (classname.equals("null"))
+            classname = name.substring(colon + 1, name.length()).trim();
+            if (classname.equals("null")) {
                 // name:null, i.e. remove it
                 classname = null;
-        }
-        else {
+            }
+        } else {
             modname = name.trim();
             classname = "org.python.modules." + modname;
         }
-        if (classname != null)
+        if (classname != null) {
             builtinNames.put(modname, classname);
-        else
+        } else {
             builtinNames.remove(modname);
+        }
     }
 
     private static void initBuiltins(Properties props) {
         builtinNames.put("sys", "");
 
         // add builtins specified in the Setup.java file
-        for (String builtinModule : Setup.builtinModules)
+        for (String builtinModule : Setup.builtinModules) {
             addBuiltin(builtinModule);
+        }
 
         // add builtins specified in the registry file
         String builtinprop = props.getProperty("python.modules.builtin", "");
         StringTokenizer tok = new StringTokenizer(builtinprop, ",");
-        while (tok.hasMoreTokens())
+        while (tok.hasMoreTokens()) {
             addBuiltin(tok.nextToken());
+        }
 
         int n = builtinNames.size();
-        PyObject [] built_mod = new PyObject[n];
+        PyObject[] built_mod = new PyObject[n];
         int i = 0;
         for (String key : builtinNames.keySet()) {
             built_mod[i++] = Py.newString(key);
                 JarEntry jarEntry = jarFile.getJarEntry("Lib/os.py");
                 standalone = jarEntry != null;
             } catch (IOException ioe) {
+                // Continue
             } finally {
                 if (jarFile != null) {
                     try {
                         jarFile.close();
                     } catch (IOException e) {
+                        // Continue
                     }
                 }
             }
     }
 
     /**
-     * @return the full name of the jar file containing this class, <code>null</code> if not available.
+     * @return the full name of the jar file containing this class, <code>null</code> if not
+     *         available.
      */
     private static String getJarFileName() {
         Class<PySystemState> thisClass = PySystemState.class;
     }
 
     private static void addPaths(PyList path, String pypath) {
-        StringTokenizer tok = new StringTokenizer(pypath,
-                                                  java.io.File.pathSeparator);
-        while  (tok.hasMoreTokens())
+        StringTokenizer tok = new StringTokenizer(pypath, java.io.File.pathSeparator);
+        while (tok.hasMoreTokens()) {
             path.append(new PyString(tok.nextToken().trim()));
+        }
     }
 
     public static PyJavaPackage add_package(String n) {
     }
 
     /**
-     * Add a classpath directory to the list of places that are searched
-     * for java packages.
+     * Add a classpath directory to the list of places that are searched for java packages.
      * <p>
-     * <b>Note</b>. Classes found in directory and subdirectory are not
-     * made available to jython by this call. It only makes the java
-     * package found in the directory available. This call is mostly
-     * usefull if jython is embedded in an application that deals with
-     * its own classloaders. A servlet container is a very good example.
-     * Calling add_classdir("<context>/WEB-INF/classes") makes the java
-     * packages in WEB-INF classes available to jython import. However the
-     * actual classloading is completely handled by the servlet container's
-     * context classloader.
+     * <b>Note</b>. Classes found in directory and sub-directory are not made available to jython by
+     * this call. It only makes the java package found in the directory available. This call is
+     * mostly useful if jython is embedded in an application that deals with its own class loaders.
+     * A servlet container is a very good example. Calling add_classdir("<context>/WEB-INF/classes")
+     * makes the java packages in WEB-INF classes available to jython import. However the actual
+     * classloading is completely handled by the servlet container's context classloader.
      */
     public static void add_classdir(String directoryPath) {
         packageManager.addDirectory(new File(directoryPath));
     }
 
     /**
-     * Add a .jar & .zip directory to the list of places that are searched
-     * for java .jar and .zip files. The .jar and .zip files found will not
-     * be cached.
+     * Add a .jar & .zip directory to the list of places that are searched for java .jar and .zip
+     * files. The .jar and .zip files found will not be cached.
      * <p>
-     * <b>Note</b>. Classes in .jar and .zip files found in the directory
-     * are not made available to jython by this call. See the note for
-     * add_classdir(dir) for more details.
+     * <b>Note</b>. Classes in .jar and .zip files found in the directory are not made available to
+     * jython by this call. See the note for add_classdir(dir) for more details.
      *
      * @param directoryPath The name of a directory.
      *
     }
 
     /**
-     * Add a .jar & .zip directory to the list of places that are searched
-     * for java .jar and .zip files.
+     * Add a .jar & .zip directory to the list of places that are searched for java .jar and .zip
+     * files.
      * <p>
-     * <b>Note</b>. Classes in .jar and .zip files found in the directory
-     * are not made available to jython by this call. See the note for
-     * add_classdir(dir) for more details.
+     * <b>Note</b>. Classes in .jar and .zip files found in the directory are not made available to
+     * jython by this call. See the note for add_classdir(dir) for more details.
      *
      * @param directoryPath The name of a directory.
-     * @param cache         Controls if the packages in the zip and jar
-     *                      file should be cached.
+     * @param cache Controls if the packages in the zip and jar file should be cached.
      *
      * @see #add_classdir
      */
         /* Print value except if None */
         /* After printing, also assign to '_' */
         /* Before, set '_' to None to avoid recursion */
-        if (o == Py.None)
-             return;
+        if (o == Py.None) {
+            return;
+        }
 
         PyObject currentBuiltins = Py.getSystemState().getBuiltins();
         currentBuiltins.__setitem__("_", Py.None);
      * Exit a Python program with the given status.
      *
      * @param status the value to exit with
-     * @exception Py.SystemExit always throws this exception.
-     * When caught at top level the program will exit.
+     * @exception Py.SystemExit always throws this exception. When caught at top level the program
+     *                will exit.
      */
     public static void exit(PyObject status) {
         throw new PyException(Py.SystemExit, status);
 
     public static PyTuple exc_info() {
         PyException exc = Py.getThreadState().exception;
-        if(exc == null)
+        if (exc == null) {
             return new PyTuple(Py.None, Py.None, Py.None);
+        }
         PyObject tb = exc.traceback;
         PyObject value = exc.value;
-        return new PyTuple(exc.type,
-                value == null ? Py.None : value,
-                tb == null ? Py.None : tb);
+        return new PyTuple(exc.type, value == null ? Py.None : value, tb == null ? Py.None : tb);
     }
 
     public static void exc_clear() {
             f = f.f_back;
             --depth;
         }
-        if (f == null)
-             throw Py.ValueError("call stack is not deep enough");
+        if (f == null) {
+            throw Py.ValueError("call stack is not deep enough");
+        }
         return f;
     }
 
      * {@link PySystemStateCloser#cleanup()} to close resources (such as still-open files). The
      * closing sequence is from last-created resource to first-created, so that dependencies between
      * them are respected. (There are some amongst layers in the _io module.)
-     * 
+     *
      * @param resourceClosers to be called in turn
      */
     private static void runClosers(Set<Callable<Void>> resourceClosers) {
 }
 
 
-class PySystemStateFunctions extends PyBuiltinFunctionSet
-{
+class PySystemStateFunctions extends PyBuiltinFunctionSet {
+
     PySystemStateFunctions(String name, int index, int minargs, int maxargs) {
         super(name, index, minargs, maxargs);
     }
 
+    @Override
     public PyObject __call__(PyObject arg) {
         switch (index) {
-        case 10:
-            PySystemState.displayhook(arg);
-            return Py.None;
-        default:
-            throw info.unexpectedCall(1, false);
+            case 10:
+                PySystemState.displayhook(arg);
+                return Py.None;
+            default:
+                throw info.unexpectedCall(1, false);
         }
     }
+
     public PyObject __call__(PyObject arg1, PyObject arg2, PyObject arg3) {
         switch (index) {
-        case 30:
-            PySystemState.excepthook(arg1, arg2, arg3);
-            return Py.None;
-        default:
-            throw info.unexpectedCall(3, false);
+            case 30:
+                PySystemState.excepthook(arg1, arg2, arg3);
+                return Py.None;
+            default:
+                throw info.unexpectedCall(3, false);
         }
     }
 }
 
+
 /**
- * Value of a class or instance variable when the corresponding
- * attribute is deleted.  Used only in PySystemState for now.
+ * Value of a class or instance variable when the corresponding attribute is deleted. Used only in
+ * PySystemState for now.
  */
 class PyAttributeDeleted extends PyObject {
+
     final static PyAttributeDeleted INSTANCE = new PyAttributeDeleted();
+
     private PyAttributeDeleted() {}
-    public String toString() { return ""; }
+
+    public String toString() {
+        return "";
+    }
+
     public Object __tojava__(Class c) {
-        if (c == PyObject.class)
+        if (c == PyObject.class) {
             return this;
+        }
         // we can't quite "delete" non-PyObject attributes; settle for
         // null or nothing
-        if (c.isPrimitive())
+        if (c.isPrimitive()) {
             return Py.NoConversion;
+        }
         return null;
     }
 }
 
+
 class Shadow {
+
     PyObject builtins;
     PyList warnoptions;
     PyObject platform;
 
 @ExposedType(name = "sys.float_info", isBaseType = false)
 class FloatInfo extends PyTuple {
+
     @ExposedGet
-    public PyObject max, max_exp, max_10_exp, min, min_exp, min_10_exp, dig,
-                    mant_dig, epsilon, radix, rounds;
+    public PyObject max, max_exp, max_10_exp, min, min_exp, min_10_exp, dig, mant_dig, epsilon,
+            radix, rounds;
 
     public static final PyType TYPE = PyType.fromClass(FloatInfo.class);
-    
-    private FloatInfo(PyObject ...vals) {
+
+    private FloatInfo(PyObject... vals) {
         super(TYPE, vals);
 
         max = vals[0];
     static public FloatInfo getInfo() {
         // max_10_exp, dig and epsilon taken from ssj library Num class
         // min_10_exp, mant_dig, radix and rounds by ɲeuroburɳ (bit.ly/Iwo2LT)
-        return new FloatInfo(
-            Py.newFloat(Double.MAX_VALUE),       // DBL_MAX
-            Py.newLong(Double.MAX_EXPONENT),     // DBL_MAX_EXP
-            Py.newLong(308),                     // DBL_MIN_10_EXP
-            Py.newFloat(Double.MIN_VALUE),       // DBL_MIN
-            Py.newLong(Double.MIN_EXPONENT),     // DBL_MIN_EXP
-            Py.newLong(-307),                    // DBL_MIN_10_EXP
-            Py.newLong(10),                      // DBL_DIG
-            Py.newLong(53),                      // DBL_MANT_DIG
-            Py.newFloat(2.2204460492503131e-16), // DBL_EPSILON
-            Py.newLong(2),                       // FLT_RADIX
-            Py.newLong(1)                        // FLT_ROUNDS
+        return new FloatInfo( //
+                Py.newFloat(Double.MAX_VALUE),       // DBL_MAX
+                Py.newLong(Double.MAX_EXPONENT),     // DBL_MAX_EXP
+                Py.newLong(308),                     // DBL_MIN_10_EXP
+                Py.newFloat(Double.MIN_VALUE),       // DBL_MIN
+                Py.newLong(Double.MIN_EXPONENT),     // DBL_MIN_EXP
+                Py.newLong(-307),                    // DBL_MIN_10_EXP
+                Py.newLong(10),                      // DBL_DIG
+                Py.newLong(53),                      // DBL_MANT_DIG
+                Py.newFloat(2.2204460492503131e-16), // DBL_EPSILON
+                Py.newLong(2),                       // FLT_RADIX
+                Py.newLong(1)                        // FLT_ROUNDS
         );
     }
 }
 
+
 @ExposedType(name = "sys.long_info", isBaseType = false)
 class LongInfo extends PyTuple {
+
     @ExposedGet
     public PyObject bits_per_digit, sizeof_digit;
 
     public static final PyType TYPE = PyType.fromClass(LongInfo.class);
-    
-    private LongInfo(PyObject ...vals) {
+
+    private LongInfo(PyObject... vals) {
         super(TYPE, vals);
 
         bits_per_digit = vals[0];
         sizeof_digit = vals[1];
     }
 
-    //XXX: I've cheated and just used the values that CPython gives me for my
-    //     local Ubuntu system. I'm not sure that they are correct.
+    // XXX: I've cheated and just used the values that CPython gives me for my
+    // local Ubuntu system. I'm not sure that they are correct.
     static public LongInfo getInfo() {
-        return new LongInfo(
-            Py.newLong(30),
-            Py.newLong(4)
-        );
+        return new LongInfo(Py.newLong(30), Py.newLong(4));
     }
 }

src/org/python/util/InteractiveConsole.java

     }
 
     /**
-     * @param replaceRawInput -
-     *            if true, we hook this Class's raw_input into the builtins
-     *            table so that clients like cmd.Cmd use it.
+     * @param replaceRawInput if true, we hook this Class's raw_input into the built-ins table so
+     *            that clients like cmd.Cmd use it.
      */
     public InteractiveConsole(PyObject locals, String filename, boolean replaceRawInput) {
         super(locals);
         this.filename = filename;
-        if(replaceRawInput) {
+        if (replaceRawInput) {
             PyObject newRawInput = new PyBuiltinFunctionSet("raw_input", 0, 0, 1) {
 
+                @Override
                 public PyObject __call__() {
                     return __call__(Py.EmptyString);
                 }
 
+                @Override
                 public PyObject __call__(PyObject prompt) {
                     return Py.newString(raw_input(prompt));
                 }
 
     /**
      * Closely emulate the interactive Python console.
-     * 
-     * The optional banner argument specifies the banner to print before the
-     * first interaction; by default it prints "Jython <version> on <platform>".
+     *
+     * The optional banner argument specifies the banner to print before the first interaction; by
+     * default it prints "Jython <version> on <platform>".
      */
     public void interact() {
         interact(getDefaultBanner(), null);
     }
 
     public void interact(String banner, PyObject file) {
-        if(banner != null) {
+        if (banner != null) {
             write(banner);
             write("\n");
         }
         exec("2");
         // System.err.println("interp2");
         boolean more = false;
-        while(true) {
+        while (true) {
             PyObject prompt = more ? systemState.ps2 : systemState.ps1;
             String line;
             try {
-        	if (file == null)
-        	    line = raw_input(prompt);
-        	else
-        	    line = raw_input(prompt, file);
-            } catch(PyException exc) {
-                if(!exc.match(Py.EOFError))
+                if (file == null) {
+                    line = raw_input(prompt);
+                } else {
+                    line = raw_input(prompt, file);
+                }
+            } catch (PyException exc) {
+                if (!exc.match(Py.EOFError)) {
                     throw exc;
+                }
                 write("\n");
                 break;
             }
 
     /**
      * Push a line to the interpreter.
-     * 
-     * The line should not have a trailing newline; it may have internal
-     * newlines. The line is appended to a buffer and the interpreter's
-     * runsource() method is called with the concatenated contents of the buffer
-     * as source. If this indicates that the command was executed or invalid,
-     * the buffer is reset; otherwise, the command is incomplete, and the buffer
-     * is left as it was after the line was appended. The return value is 1 if
-     * more input is required, 0 if the line was dealt with in some way (this is
-     * the same as runsource()).
+     *
+     * The line should not have a trailing newline; it may have internal newlines. The line is
+     * appended to a buffer and the interpreter's runsource() method is called with the concatenated
+     * contents of the buffer as source. If this indicates that the command was executed or invalid,
+     * the buffer is reset; otherwise, the command is incomplete, and the buffer is left as it was
+     * after the line was appended. The return value is 1 if more input is required, 0 if the line
+     * was dealt with in some way (this is the same as runsource()).
      */
     public boolean push(String line) {
-        if(buffer.length() > 0)
+        if (buffer.length() > 0) {
             buffer.append("\n");
+        }
         buffer.append(line);
         boolean more = runsource(buffer.toString(), filename);
-        if(!more)
+        if (!more) {
             resetbuffer();
+        }
         return more;
     }
 
     /**
-     * Write a prompt and read a line from standard input.
-     * 
-     * The returned line does not include the trailing newline. When the user
-     * enters the EOF key sequence, EOFError is raised.
-     * 
-     * The base implementation uses the built-in function raw_input(); a
-     * subclass may replace this with a different implementation.
+     * Write a prompt and read a line from standard input. The returned line does not include the
+     * trailing newline. When the user enters the EOF key sequence, EOFError is raised. The base
+     * implementation uses the built-in function raw_input(); a subclass may replace this with a
+     * different implementation.
      */
     public String raw_input(PyObject prompt) {
         return __builtin__.raw_input(prompt);
     }
-    
+
     /**
      * Write a prompt and read a line from a file.
      */
     public String raw_input(PyObject prompt, PyObject file) {
-	return __builtin__.raw_input(prompt, file);
+        return __builtin__.raw_input(prompt, file);
     }
 }

src/org/python/util/JLineConsole.java

 import java.util.Arrays;
 import java.util.List;
 
-import jnr.constants.platform.Errno;
-
 import jline.ConsoleReader;
 import jline.Terminal;
 import jline.WindowsTerminal;
+import jnr.constants.platform.Errno;
 
 import org.python.core.Py;
 import org.python.core.PyObject;
 
 /**
- * This class uses <a href="http://jline.sourceforge.net/">JLine</a> to provide
- * readline like functionality to its console without requiring native readline
- * support.
+ * This class uses <a href="http://jline.sourceforge.net/">JLine</a> to provide readline like
+ * functionality to its console without requiring native readline support.
  */
 public class JLineConsole extends InteractiveConsole {
 
     protected static final String CTRL_Z = "\u001a";
 
     /**
-     * Errno strerrors possibly caused by a SIGSTP (ctrl-z). They may propagate up to
-     * IOException messages.
+     * Errno strerrors possibly caused by a SIGSTP (ctrl-z). They may propagate up to IOException
+     * messages.
      */
-    private static final List<String> SUSPENDED_STRERRORS =
-            Arrays.asList(Errno.EINTR.description(), Errno.EIO.description());
+    private static final List<String> SUSPENDED_STRERRORS = Arrays.asList(
+            Errno.EINTR.description(), Errno.EIO.description());
 
     public JLineConsole() {
         this(null);
         try {
             InputStream input = new FileInputStream(FileDescriptor.in);
             // Raw bytes in, so raw bytes out
-            Writer output = new OutputStreamWriter(new FileOutputStream(FileDescriptor.out),
-                                                   "ISO-8859-1");
+            Writer output =
+                    new OutputStreamWriter(new FileOutputStream(FileDescriptor.out), "ISO-8859-1");
             reader = new ConsoleReader(input, output, getBindings());
             reader.setBellEnabled(false);
         } catch (IOException e) {
     /**
      * Return the JLine bindings file.
      *
-     * This handles loading the user's custom keybindings (normally JLine does) so it can
-     * fallback to Jython's (which disable tab completition) when the user's are not
-     * available.
+     * This handles loading the user's custom key bindings (normally JLine does) so it can fall back
+     * to Jython's (which disable tab completion) when the user's are not available.
      *
      * @return an InputStream of the JLine bindings file.
      */
     protected InputStream getBindings() {
-        String userBindings = new File(System.getProperty("user.home"),
-                                       ".jlinebindings.properties").getAbsolutePath();
+        String userBindings =
+                new File(System.getProperty("user.home"), ".jlinebindings.properties")
+                        .getAbsolutePath();
         File bindingsFile = new File(System.getProperty("jline.keybindings", userBindings));
 
         try {
     }
 
     /**
-     * Determine if the IOException was likely caused by a SIGSTP (ctrl-z). Seems only
-     * applicable to BSD platforms.
+     * Determine if the IOException was likely caused by a SIGSTP (ctrl-z). Seems only applicable to
+     * BSD platforms.
      */
     private boolean fromSuspend(IOException ioe) {
         return !windows && SUSPENDED_STRERRORS.contains(ioe.getMessage());
         return reader;
     }
 
-
     /**
      * @return the startup hook (called prior to each readline)
      */

src/org/python/util/jython.java

 import org.python.modules.thread.thread;
 
 public class jython {
+
     private static final String COPYRIGHT =
-        "Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.";
+            "Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.";
 
     static final String usageHeader =
-        "usage: jython [option] ... [-c cmd | -m mod | file | -] [arg] ...\n";
+            "usage: jython [option] ... [-c cmd | -m mod | file | -] [arg] ...\n";
 
-    private static final String usage = usageHeader +
-        "Options and arguments:\n" + //(and corresponding environment variables):\n" +
-        "-B       : don't write .py[co] files on import\n" + // "; also PYTHONDONTWRITEBYTECODE=x\n" +
-        "-c cmd   : program passed in as string (terminates option list)\n" +
-        //"-d       : debug output from parser (also PYTHONDEBUG=x)\n" +
-        "-Dprop=v : Set the property `prop' to value `v'\n"+
-        //"-E       : ignore environment variables (such as PYTHONPATH)\n" +
-        "-C codec : Use a different codec when reading from the console.\n"+
-        "-h       : print this help message and exit (also --help)\n" +
-        "-i       : inspect interactively after running script\n" + //, (also PYTHONINSPECT=x)\n" +
-        "           and force prompts, even if stdin does not appear to be a terminal\n" +
-        "-jar jar : program read from __run__.py in jar file\n"+
-        "-m mod   : run library module as a script (terminates option list)\n" +
-        //"-O       : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)\n" +
-        //"-OO      : remove doc-strings in addition to the -O optimizations\n" +
-        "-Q arg   : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n" +
-        "-s       : don't add user site directory to sys.path;\n" + // also PYTHONNOUSERSITE\n" +
-        "-S       : don't imply 'import site' on initialization\n" +
-        //"-t       : issue warnings about inconsistent tab usage (-tt: issue errors)\n" +
-        "-u       : unbuffered binary stdout and stderr\n" + // (also PYTHONUNBUFFERED=x)\n" +
-        //"           see man page for details on internal buffering relating to '-u'\n" +
-        "-v       : verbose (trace import statements)\n" + // (also PYTHONVERBOSE=x)\n" +
-        "           can be supplied multiple times to increase verbosity\n" +
-        "-V       : print the Python version number and exit (also --version)\n" +
-        "-W arg   : warning control (arg is action:message:category:module:lineno)\n" +
-        //"-x       : skip first line of source, allowing use of non-Unix forms of #!cmd\n" +
-        "-3       : warn about Python 3.x incompatibilities that 2to3 cannot trivially fix\n" +
-        "file     : program read from script file\n" +
-        "-        : program read from stdin (default; interactive mode if a tty)\n" +
-        "arg ...  : arguments passed to program in sys.argv[1:]\n" +
-        "\n" +
-        "Other environment variables:\n" +
-        "JYTHONPATH: '" + File.pathSeparator +
-        "'-separated list of directories prefixed to the default module\n" +
-        "            search path.  The result is sys.path.";
+    private static final String usage = usageHeader
+            + "Options and arguments:\n"
+            // + "(and corresponding environment variables):\n"
+            + "-B       : don't write .py[co] files on import\n"
+            // + "also PYTHONDONTWRITEBYTECODE=x\n" +
+            + "-c cmd   : program passed in as string (terminates option list)\n"
+            // + "-d       : debug output from parser (also PYTHONDEBUG=x)\n"
+            + "-Dprop=v : Set the property `prop' to value `v'\n"
+            // + "-E       : ignore environment variables (such as PYTHONPATH)\n"
+            + "-C codec : Use a different codec when reading from the console.\n"
+            + "-h       : print this help message and exit (also --help)\n"
+            + "-i       : inspect interactively after running script\n"
+            // + ", (also PYTHONINSPECT=x)\n"
+            + "           and force prompts, even if stdin does not appear to be a terminal\n"
+            + "-jar jar : program read from __run__.py in jar file\n"
+            + "-m mod   : run library module as a script (terminates option list)\n"
+            // + "-O       : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)\n"
+            // + "-OO      : remove doc-strings in addition to the -O optimizations\n"
+            + "-Q arg   : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n"
+            + "-s       : don't add user site directory to sys.path;\n"
+            // + "also PYTHONNOUSERSITE\n"
+            + "-S       : don't imply 'import site' on initialization\n"
+            // + "-t       : issue warnings about inconsistent tab usage (-tt: issue errors)\n"
+            + "-u       : unbuffered binary stdout and stderr\n"
+            // + "(also PYTHONUNBUFFERED=x)\n"
+            // + "           see man page for details on internal buffering relating to '-u'\n"
+            + "-v       : verbose (trace import statements)\n"
+            // + "(also PYTHONVERBOSE=x)\n"
+            + "           can be supplied multiple times to increase verbosity\n"
+            + "-V       : print the Python version number and exit (also --version)\n"
+            + "-W arg   : warning control (arg is action:message:category:module:lineno)\n"
+            // + "-x       : skip first line of source, allowing use of non-Unix forms of #!cmd\n"
+            + "-3       : warn about Python 3.x incompatibilities that 2to3 cannot trivially fix\n"
+            + "file     : program read from script file\n"
+            + "-        : program read from stdin (default; interactive mode if a tty)\n"
+            + "arg ...  : arguments passed to program in sys.argv[1:]\n" + "\n"
+            + "Other environment variables:\n" + "JYTHONPATH: '" + File.pathSeparator
+            + "'-separated list of directories prefixed to the default module\n"
+            + "            search path.  The result is sys.path.";
 
     public static boolean shouldRestart;
 
     /**
-     * Runs a JAR file, by executing the code found in the file __run__.py, 
-     * which should be in the root of the  JAR archive. 
-     * 
-     * Note that the __name__ is set to the base name of the JAR file and not 
-     * to "__main__" (for historic reasons). 
-     * 
-     * This method do NOT handle exceptions. the caller SHOULD handle any 
-     * (Py)Exceptions thrown by the code.
-     * 
-     * @param filename The path to the filename to run. 
+     * Runs a JAR file, by executing the code found in the file __run__.py, which should be in the
+     * root of the JAR archive. Note that the __name__ is set to the base name of the JAR file and
+     * not to "__main__" (for historic reasons). This method do NOT handle exceptions. the caller
+     * SHOULD handle any (Py)Exceptions thrown by the code.
+     *
+     * @param filename The path to the filename to run.
      */
     public static void runJar(String filename) {
         // TBD: this is kind of gross because a local called `zipfile' just magically
-        // shows up in the module's globals.  Either `zipfile' should be called
-        // `__zipfile__' or (preferrably, IMO), __run__.py should be imported and a main()
-        // function extracted.  This function should be called passing zipfile in as an
+        // shows up in the module's globals. Either `zipfile' should be called
+        // `__zipfile__' or (preferably, IMO), __run__.py should be imported and a main()
+        // function extracted. This function should be called passing zipfile in as an
         // argument.
         //
         // Probably have to keep this code around for backwards compatibility (?)
                 return opts;
             }
 
-
             for (String opt : envVar.split(",")) {
                 opt = opt.trim();
                 if (opt.length() == 0) {
                 opts.add(opt);
             }
         } catch (SecurityException e) {
+            // Continue
         }
 
         return opts;
     }
 
-    private static List<String> validWarnActions = Arrays.asList(
-        "error", "ignore", "always", "default", "module", "once");
+    private static List<String> validWarnActions = Arrays.asList("error", "ignore", "always",
+            "default", "module", "once");
 
     private static void addWarnings(List<String> from, PyList to) {
         outerLoop : for (String opt : from) {
                 if (validWarnAction.startsWith(action)) {
                     if (opt.contains(":")) {
                         to.append(Py.newString(validWarnAction + opt.substring(opt.indexOf(":"))));
-                    }
-                    else {
+                    } else {
                         to.append(Py.newString(validWarnAction));
                     }
                     continue outerLoop;
                 }
             }
-            System.err.println(String.format("Invalid -W option ignored: invalid action: '%s'", action));
+            System.err.println(String.format("Invalid -W option ignored: invalid action: '%s'",
+                    action));
         }
     }
 
             imp.load("warnings");
         }
 
-
         // Decide if stdin is interactive
         if (!opts.fixInteractive || opts.interactive) {
             opts.interactive = ((PyFile)Py.defaultSystemState.stdin).isatty();
         if (opts.filename != null) {
             String path;
             try {
-                 path = new File(opts.filename).getCanonicalFile().getParent();
+                path = new File(opts.filename).getCanonicalFile().getParent();
             } catch (IOException ioe) {
-                 path = new File(opts.filename).getAbsoluteFile().getParent();
+                path = new File(opts.filename).getAbsoluteFile().getParent();
             }
             if (path == null) {
                 path = "";
             }
             Py.getSystemState().path.insert(0, new PyString(path));
             if (opts.jar) {
-            	try {
-            		runJar(opts.filename);
-            	} catch (Throwable t) {
+                try {
+                    runJar(opts.filename);
+                } catch (Throwable t) {
                     Py.printException(t);
-                    System.exit(-1);            		
-            	}
+                    System.exit(-1);
+                }
             } else if (opts.filename.equals("-")) {
                 try {
                     interp.globals.__setitem__(new PyString("__file__"), new PyString("<stdin>"));
                 }
             } else {
                 try {
-                   interp.globals.__setitem__(new PyString("__file__"),
-                                              new PyString(opts.filename));
+                    interp.globals.__setitem__(new PyString("__file__"),
+                            new PyString(opts.filename));
 
-                   FileInputStream file;
-                   try {
-                       file = new FileInputStream(new RelativeFile(opts.filename));
-                   } catch (FileNotFoundException e) {
-                       throw Py.IOError(e);
-                   }
-                   try {
-                       if (PosixModule.getPOSIX().isatty(file.getFD())) {
-                           opts.interactive = true;
-                           interp.interact(null, new PyFile(file));
-                           return;
-                       } else {
-                           interp.execfile(file, opts.filename);
-                       }
-                   } finally {
-                       file.close();
-                   }
+                    FileInputStream file;
+                    try {
+                        file = new FileInputStream(new RelativeFile(opts.filename));
+                    } catch (FileNotFoundException e) {
+                        throw Py.IOError(e);
+                    }
+                    try {
+                        if (PosixModule.getPOSIX().isatty(file.getFD())) {
+                            opts.interactive = true;
+                            interp.interact(null, new PyFile(file));
+                            return;
+                        } else {
+                            interp.execfile(file, opts.filename);
+                        }
+                    } finally {
+                        file.close();
+                    }
                 } catch (Throwable t) {
                     if (t instanceof PyException
-                        && ((PyException)t).match(_systemrestart.SystemRestart)) {
+                            && ((PyException)t).match(_systemrestart.SystemRestart)) {
                         // Shutdown this instance...
                         shouldRestart = true;
                         shutdownInterpreter();
                     }
                 }
             }
-        }
-        else {
+        } else {
             // if there was no file name on the command line, then "" is the first element
-            // on sys.path.  This is here because if there /was/ a filename on the c.l.,
+            // on sys.path. This is here because if there /was/ a filename on the c.l.,
             // and say the -i option was given, sys.path[0] will have gotten filled in
             // with the dir of the argument filename.
             Py.getSystemState().path.insert(0, Py.EmptyString);
             if (opts.encoding != null) {
                 if (!Charset.isSupported(opts.encoding)) {
                     System.err.println(opts.encoding
-                                       + " is not a supported encoding on this JVM, so it can't "
-                                       + "be used in python.console.encoding.");
+                            + " is not a supported encoding on this JVM, so it can't "
+                            + "be used in python.console.encoding.");
                     System.exit(1);
                 }
                 interp.cflags.encoding = opts.encoding;
      * Returns a new python interpreter using the InteractiveConsole subclass from the
      * <tt>python.console</tt> registry key.
      * <p>
-
-     * When stdin is interactive the default is {@link JLineConsole}. Otherwise the
-     * featureless {@link InteractiveConsole} is always used as alternative consoles cause
-     * unexpected behavior with the std file streams.
+     * When stdin is interactive the default is {@link JLineConsole}. Otherwise the featureless
+     * {@link InteractiveConsole} is always used as alternative consoles cause unexpected behavior
+     * with the std file streams.
      */
     private static InteractiveConsole newInterpreter(boolean interactiveStdin) {
         if (!interactiveStdin) {
     }
 }
 
+
 class CommandLineOptions {
+
     public String filename;
     public boolean jar, interactive, notice;
     public boolean runCommand, runModule;
             // continue
         }
     }
-    
+
     private boolean argumentExpected(String arg) {
         System.err.println("Argument expected for the " + arg + " option");
         return false;
             } else if (arg.equals("-vv")) {
                 Options.verbose += 2;
             } else if (arg.equals("-vvv")) {
-                Options.verbose +=3 ;
+                Options.verbose += 3;
             } else if (arg.equals("-s")) {
                 Options.no_user_site = true;
             } else if (arg.equals("-S")) {
                 encoding = args[++index];
                 setProperty("python.console.encoding", encoding);
             } else if (arg.equals("-E")) {
-                // XXX: accept -E (ignore environment variables) to be compatiable with
+                // XXX: accept -E (ignore environment variables) to be compatible with
                 // CPython. do nothing for now (we could ignore the registry)
                 Options.ignore_environment = true;
             } else if (arg.startsWith("-D")) {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.