0 Replies Latest reply on Jul 12, 2012 5:00 AM by CaesarZou

    bugs on JCDK 3.0.4

      Hi all,
      I found some bug on converter of the JCDK v3.0.4.

      1. In some case (some class in package implements the Shareable interface, exp) , the ant task of converter throws error like this:
      [convert] error: Java property "jc.home" is not set.
      [convert] com.sun.javacard.converter.ConverterException
      [convert] Cap file generation failed.
      But, when convert same package with the JCDK/bin/converter.bat directly, it's fine.
      By watched the convert.bat file, and decompiled the jctask.jar, I got the bug.
      According to convert.bat file: "%JAVA_HOME%\bin\java" -Djc.home=%JC_CLASSIC_HOME% -classpath %JC_CLASSPATH% com.sun.javacard.converter.Main %*, we found there is a arg named jc.home is needed in com.sun.javacard.converter.Main. when this Class is forked in the ant task, this arg is missing.
      Because converterTask is the subclass of JavaTask and extended the JavaTask's attributes, so can fixed the bug by add this attributes to task XML: <jvmarg value="-Djc.home=${env.JC_CLASSIC_HOME}"/>, but it's should still be treated as a bug.

      2.When a Shareable interface is implements by other package, in the out-dir a same package and a same java and class file of the Interface is created . and this java file and class file may not same as original one, the fileds of Interface is deleted, only keep the methods. If we use the same SrcDir and DstDir, the package of the Shareable Interface 's class file will be replaced, and will failed in convert.

      here is the my example xml file of ant in v3.0.4
      <convert JCA="true" CAP="true" EXP="true" ClassDir="${JCAPI_BIN}" Outputdirectory="${JCAPI_CAP}" exportmap="true" debug="true" packagename="org.globalplatform" packageaid="0xA0:0x00:0x00:0x01:0x51:0x00" majorminorversion="1.0">
                     <jvmarg value="-Djc.home=${JC_HOME}"/>
                     <exportpath path="${JCAPI_EXP}" ></exportpath>
                     <classpath refid="CONVERTER_PATH" />
      it's very complex then v 2.2.2
      <convert JCA="true" CAP="true" EXP="true" dir="${JCAPI_BIN}" exportmap="true" debug="true" packagename="org.globalplatform" packageaid="0xA0:0x00:0x00:0x01:0x51:0x00" majorminorversion="1.0">
                     <exportpath path="${JCAPI_EXP}" ></exportpath>
                     <classpath refid="CONVER_PATH" />

      look forward to the bug's fixed.
      your Caesar Zou

      Edited by: 945920 on 2012-7-11 下午10:00