b2202480258b6f2f5f4e020e86cde975088c7792,src/python/pants/backend/jvm/tasks/jar_create.py,JarCreate,execute,#JarCreate#,70

Before Change


        with self.create_jar(target, jar_path) as jarfile:
          with self.create_jar_builder(jarfile) as jar_builder:
            if target in jar_builder.add_target(target):
              self.context.products.get("jars").add(target, self.workdir).append(jar_name)

  @contextmanager
  def create_jar(self, target, path):

After Change


        jar_mapping = self.context.products.get("jars")

        for vt in invalidation_check.all_vts:
          jar_name = vt.target.name + ".jar"
          jar_path = os.path.join(vt.results_dir, jar_name)

          def add_jar_to_products():
            jar_mapping.add(vt.target, vt.results_dir).append(jar_name)

          if vt.valid:
            if os.path.exists(jar_path):
              add_jar_to_products()
          else:
            with self.create_jar(vt.target, jar_path) as jarfile:
              with self.create_jar_builder(jarfile) as jar_builder:
                if vt.target in jar_builder.add_target(vt.target):
                  add_jar_to_products()

  @contextmanager
  def create_jar(self, target, path):
    existing = self._jars.setdefault(path, target)
    if target != existing:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pantsbuild/pants
Commit Name: b2202480258b6f2f5f4e020e86cde975088c7792
Time: 2015-07-11
Author: codyhgibb@gmail.com
File Name: src/python/pants/backend/jvm/tasks/jar_create.py
Class Name: JarCreate
Method Name: execute


Project Name: pantsbuild/pants
Commit Name: d064804b3acf89a30fefae3f6900f0414e3e3416
Time: 2019-04-20
Author: stuhood@twitter.com
File Name: src/python/pants/option/options.py
Class Name: Options
Method Name: complete_scopes


Project Name: pantsbuild/pants
Commit Name: a6add8ae090edaf8ce525d49d9fe0cf38a0a91c7
Time: 2021-03-23
Author: 14852634+Eric-Arellano@users.noreply.github.com
File Name: src/python/pants/backend/python/dependency_inference/module_mapper.py
Class Name:
Method Name: merge_first_party_module_mappings