05d7240153788a0d35c514ac9942a8a87ed6e1ef,contrib/jax_ws/src/python/pants/contrib/jax_ws/tasks/jax_ws_gen.py,JaxWsGen,execute_codegen,#JaxWsGen#Any#Any#,48

Before Change


    return [cls.IsolatedCodegenStrategy]

  def execute_codegen(self, target, target_workdir):
    distribution = DistributionLocator.cached(jdk=True)
    // Note, using tools.jar will only work with Java 8 and lower.  The tools.jar does not exist
    // in JDK 9 and this will have to be revisted when Java 9 is released.
    // See http://openjdk.java.net/jeps/220 for more information
    classpath = distribution.find_libs(["tools.jar"])

    wsdl_directory = target.payload.sources.rel_path
    for source in target.payload.sources.source_paths:
      url = os.path.join(wsdl_directory, source)

      args = self._format_args_for_relative_path(target, target_workdir, url)

      result = self.runjava(
        classpath=classpath,
        main="com.sun.tools.internal.ws.WsImport",
        jvm_options=self.get_options().jvm_options,
        args=args,
        workunit_name="wsimport")
      if result != 0:
        raise TaskError("JAX-WS compiler exited non-zero ({0})".format(result))

  def _format_args_for_relative_path(self, target, target_workdir, url):
    // Ported and trimmed down from:
    // https://java.net/projects/jax-ws-commons/sources/svn/content/trunk/
    // jaxws-maven-plugin/src/main/java/org/jvnet/jax_ws_commons/jaxws/WsImportMojo.java?rev=1191

After Change


      wsimport_cmd = self._build_wsimport_cmd(target, target_workdir, url)
      with self.context.new_workunit(name="wsimport",
                                     cmd=" ".join(wsimport_cmd),
                                     labels=[WorkUnitLabel.TOOL]) as workunit:
        self.context.log.debug("Executing {}".format(" ".join(wsimport_cmd)))
        return_code = subprocess.Popen(wsimport_cmd,
                                       stdout=workunit.output("stdout"),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: pantsbuild/pants
Commit Name: 05d7240153788a0d35c514ac9942a8a87ed6e1ef
Time: 2017-11-08
Author: cheister@gmail.com
File Name: contrib/jax_ws/src/python/pants/contrib/jax_ws/tasks/jax_ws_gen.py
Class Name: JaxWsGen
Method Name: execute_codegen


Project Name: pantsbuild/pants
Commit Name: 78a526959260d7ce561b9ead625acb4837f900d0
Time: 2018-12-14
Author: john.sirois@gmail.com
File Name: src/python/pants/backend/python/tasks/python_tool_prep_base.py
Class Name: PythonToolPrepBase
Method Name: execute


Project Name: pantsbuild/pants
Commit Name: 02601118f6edf725e64e2471def69e0114ae3845
Time: 2015-02-02
Author: mateorod9@gmail.com
File Name: src/python/pants/backend/android/tasks/aapt_gen.py
Class Name: AaptGen
Method Name: genlang