Java表达式语言错误“;”预期

时间:2012-02-14 18:06:59

标签: java

好的我是初学者,我必须修复这个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

1 个答案:

答案 0 :(得分:5)

If应为小写。

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