gpt4 book ai didi

Java 表达式语言错误 ";"预期

转载 作者:行者123 更新时间:2023-12-01 17:32:55 29 4
gpt4 key购买 nike

好的,我是初学者,我必须修复此 java 表达式语言代码才能在我的系统 (Windchill) 中工作,但看起来我在语法中遗漏了一些内容:

    LWCNormalizedObject lwc = new LWCNormalizedObject(cr, null, null, null);
lwc.load(wt.change2.WTChangeRequest2.theCategory);
Object bUnit = lwc.get(wt.change2.WTChangeRequest2.theCategory);
If ((bUnit.toString()).equals("PRODUCT_IMPROVEMENT")) {
wt.team.Team team = (wt.team.Team) ( (wt.workflow.engine.WfProcess) self.getObject() ).getTeamId().getObject();
java.util.Enumeration principals = team.getPrincipalTarget(wt.project.Role.toRole("Product Manager"));
while(principals.hasMoreElements())
{
wt.org.WTPrincipal wtprincipal = ((wt.org.WTPrincipalReference)principals.nextElement()).getPrincipal();
System.out.println("principal = " + wtprincipal.getPrincipalDisplayIdentifier());
wt.team.TeamHelper.service.addRolePrincipalMap(wt.project.Role.toRole("Change Admin II "),wtprincipal, team );
}
}

我在第 4 行遇到错误:

    If ((bUnit.toString()).equals("PRODUCT_IMPROVEMENT")) {

任何帮助将不胜感激=D

最佳答案

If 应该小写。

if ((bUnit.toString()).equals("PRODUCT_IMPROVMENT")) {

关于Java 表达式语言错误 ";"预期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9281918/

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