有人请告诉我为什么我在其他分支中收到死代码警告if (projectId != null)?如果我做对了,翻译认为projectId永远不会是空的 - 是吗?在我看来,这是不可能的......
Integer projectId = null;
if (!sprintTaskConnections.isEmpty())
projectId = sprintTaskConnections.get(0).getProjectId();
// init name, state, startDate, endDate here
JiraSprint sprint = new JiraSprint(sprintInfo.getInt("id"), name, state, projectId, startDate, endDate);
if (projectId != null)
{
...
}
Run Code Online (Sandbox Code Playgroud)
即使我放了一个
sprintTaskConnections.add(new JiraSprintTaskConnection(1, 1, 1));
Run Code Online (Sandbox Code Playgroud)
或者a
sprintTaskConnections.clear();
Run Code Online (Sandbox Code Playgroud)
在...前面
if (!sprintTaskConnections.isEmpty())
projectId = sprintTaskConnections.get(0).getProjectId();
Run Code Online (Sandbox Code Playgroud)
结果总是一样的!
请帮助我,我现在还没有得到它!