5c855faa3e2073e35f448ffe93363b4df082c48e,script/formatting/formatter.py,,format_java_file,#Any#Any#Any#,100

Before Change


        if not os.path.exists(JAVA_JAR_PATH):
            controller_dir = os.path.join(OTTERTUNE_DIR, "controller")
            subprocess.check_output(["gradle", "downloadJars"], cwd=controller_dir)
        subprocess.check_output(["java", "-jar", JAVA_JAR_PATH, "-r", file_path])


def format_python_file(file_path, update_header, format_code):
    if not file_path.endswith(".py"):

After Change



    if format_code:
        if not os.path.exists(JAVA_JAR_PATH):
            local((
                "wget https://github.com/google/google-java-format/"
                "releases/download/google-java-format-{0}/"
                "google-java-format-{0}-all-deps.jar && "
                "mv {1} {2}").format(
                    JAVA_JAR_VERSION,
                    os.path.basename(JAVA_JAR_PATH),
                    JAVA_JAR_PATH))

        local("java -jar {} -r {}".format(JAVA_JAR_PATH, file_path))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 2

Instances


Project Name: cmu-db/ottertune
Commit Name: 5c855faa3e2073e35f448ffe93363b4df082c48e
Time: 2019-10-23
Author: dvanaken@cs.cmu.edu
File Name: script/formatting/formatter.py
Class Name:
Method Name: format_java_file


Project Name: osmr/imgclsmob
Commit Name: 9fdda668798307398f9d8ee3dd03fe57f912559a
Time: 2018-08-05
Author: osemery@gmail.com
File Name: common/env_stats.py
Class Name:
Method Name: get_pyenv_info


Project Name: NifTK/NiftyNet
Commit Name: 5da29e81cd7fc5780ccb97491ae9ed4b85fff410
Time: 2017-07-27
Author: d.shakir@ucl.ac.uk
File Name: setup.py
Class Name:
Method Name:


Project Name: deepgram/kur
Commit Name: c10177e717a57c5db8b0e8ab7efa07051e77c4be
Time: 2016-12-05
Author: ajsyp@syptech.net
File Name: setup.py
Class Name:
Method Name: get_version