gpt4 book ai didi

java - cobertura报告出现大量错误: JavaNCSS got an error while parsing the java file

转载 作者:搜寻专家 更新时间:2023-10-31 08:04:05 25 4
gpt4 key购买 nike

[cobertura-report] net.sourceforge.cobertura.javancss.parser.TokenMgrError: Lexical error at line 29, column 59. Encountered: "\r" (13), after : "\"\u5bb8\u832c\u7ca1\u5a75\ufffd\u693f\u6769\ufffd;"
[cobertura-report] at net.sourceforge.cobertura.javancss.parser.JavaParserTokenManager.getNextToken(JavaParserTokenManager.java:2078)

[cobertura-report] 2012 04 23 15:55:39,797 WARN 0 ComplexityCalculator:107(main) - JavaNCSS got an error while parsing the java file D:\testworkspace\HT20120420\src\com\cnbab\proj118\regnlogin\action\ActivateUserByEmail.java
[cobertura-report] TokenMgrError in STDIN
[cobertura-report] Lexical error at line 29, column 59. Encountered: "\r" (13), after : "\"\u5bb8\u832c\u7ca1\u5a75\ufffd\u693f\u6769\ufffd;"

[cobertura-report] 2012 04 23 15:55:39,814 WARN 17 ComplexityCalculator:107(main) - JavaNCSS got an error while parsing the java file D:\testworkspace\HT20120420\src\com\cnbab\proj118\regnlogin\action\ActivateUserBySms.java
[cobertura-report] TokenMgrError in STDIN
[cobertura-report] Lexical error at line 32, column 59. Encountered: "\r" (13), after : "\"\u5bb8\u832c\u7ca1\u5a75\ufffd\u693f\u6769\ufffd;"
[cobertura-report] at net.sourceforge.cobertura.reporting.html.HTMLReport.generateTableRowForTotal(HTMLReport.java:704)

[cobertura-report] 2012 04 23 15:55:39,821 WARN 24 ComplexityCalculator:107(main) - JavaNCSS got an error while parsing the java file D:\testworkspace\HT20120420\src\com\cnbab\proj118\regnlogin\action\LoginEntry.java
[cobertura-report] TokenMgrError in STDIN
[cobertura-report] Lexical error at line 24, column 70. Encountered: "\r" (13), after : "\"\u9427\u8bf2\u7d8d\u935a\u5d84\u7b09\u9473\u6212\u8d1f\u7ecc\ufffd);"
[cobertura-report] net.sourceforge.cobertura.javancss.parser.TokenMgrError: Lexical error at line 86, column 69. Encountered: "\r" (13), after : "\"\u6d93\ue043\u7d8b\u5bb8\u30e5\u6662\u93b4\ufffd))"
[cobertura-report] at net.sourceforge.cobertura.javancss.parser.JavaParserTokenManager.getNextToken(JavaParserTokenManager.java:2078)
[cobertura-report] at net.sourceforge.cobertura.javancss.parser.JavaParser.jj_scan_token(JavaParser.java:10181)
[cobertura-report] at net.sourceforge.cobertura.javancss.parser.JavaParser.jj_3R_198(JavaParser.java:8524)

              if(strRet.equals("01"))
return SUCCESS;
else{
if(strRet.equals("02"))
this.strError = "已被激活";
if(strRet.equals("03"))
this.strError = "未被激活";
if(strRet.equals("04"))
this.strError = "没有这个用户";
return ERROR;

出现上述原因是程序有很多中文信息(utf-8)编码(如上面的代码),cobertura instrument编译不通过,网上资料在()bat文件(cobertura-instrument.bat)中。 bat) 添加“-Dfile.encoding=utf-8”编码或者Java环境变量添加“-Dfile.encoding=utf-8”编码都可以解决,但是我在ant build.xml中,我添加了很多编码= "utf-8"没解决。请各位指教!。

最佳答案

试试这个选项:

  1. 将 -Dfile.encoding=iso-8859-1 添加到您的 ANT_OPTS 环境变量
  2. use <presetdef> to setup defaults for all of your <javac> invocations

关于java - cobertura报告出现大量错误: JavaNCSS got an error while parsing the java file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10277565/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com