427bd0f33076c2595dceb0dfd5bca00a06f95498,src/python/pants/backend/jvm/tasks/jar_create.py,JarCreate,execute,#JarCreate#,121

Before Change


        self.sourcejar(jar_targets(is_jvm_library), functools.partial(add_genjar, "source_jars"))

      if self.jar_javadoc:
        javadoc_add_genjar = functools.partial(add_genjar, "javadoc_jars")
        self.javadocjar(jar_targets(is_java_library),
                        self.context.products.get("javadoc"),
                        javadoc_add_genjar)
        self.javadocjar(jar_targets(is_scala_library),

After Change


    safe_mkdir(self.workdir)

    with self.context.new_workunit(name="jar-create", labels=[WorkUnit.MULTITOOL]):
      for target in self.context.targets(is_jvm_library):
        jar_name = jarname(target)
        jar_path = os.path.join(self.workdir, jar_name)
        with self.create_jar(target, jar_path) as jarfile:
          if self._jar_builder.add_target(jarfile, target):
            self.context.products.get("jars").add(target, self.workdir).append(jar_name)

  @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: 6

Instances


Project Name: pantsbuild/pants
Commit Name: 427bd0f33076c2595dceb0dfd5bca00a06f95498
Time: 2014-07-10
Author: john.sirois@gmail.com
File Name: src/python/pants/backend/jvm/tasks/jar_create.py
Class Name: JarCreate
Method Name: execute


Project Name: tech-srl/code2vec
Commit Name: 89fcfe5f49502043e45de93c47acfc6de2180647
Time: 2019-04-05
Author: eladnah@gmail.com
File Name: keras_model.py
Class Name: Code2VecModel
Method Name: _create_metrics_for_keras_model


Project Name: home-assistant/home-assistant
Commit Name: 95b98f67527bfcadc61d92910648c7fbd9c22746
Time: 2016-08-26
Author: pascal.vizeli@syshack.ch
File Name: homeassistant/components/homematic.py
Class Name:
Method Name: setup