try
{
result = (Boolean) new CriticalSection()
{
protected Object perform() throws DraftStorageAccessException, DraftDataAccessException
{
DraftState draftState = StatefulDraftUtil.getDraftState(draftDescriptor);
if (draftState.getStateId() == DraftState.NONE_STATE)
{
return Boolean.FALSE;
}
else
{
return Boolean.TRUE;
}
}
}.execute(draftDescriptor);
}
catch (DraftStorageAccessException e)
{
LOGGER.log(Level.SEVERE, "DraftStorageManager Internal Error. {0} {1}", new Object[] { draftDescriptor, e });
throw new IllegalStateException();
{
result = (Boolean) new CriticalSection()
{
protected Object perform() throws DraftStorageAccessException, DraftDataAccessException
{
DraftState draftState = StatefulDraftUtil.getDraftState(draftDescriptor);
if (draftState.getStateId() == DraftState.NONE_STATE)
{
return Boolean.FALSE;
}
else
{
return Boolean.TRUE;
}
}
}.execute(draftDescriptor);
}
catch (DraftStorageAccessException e)
{
LOGGER.log(Level.SEVERE, "DraftStorageManager Internal Error. {0} {1}", new Object[] { draftDescriptor, e });
throw new IllegalStateException();
}
问了宅男,才明白原来代码是这个意思
差距啊!!!
本文深入解析了一段复杂的代码逻辑,包括尝试创建一个新临界区,执行特定操作并捕获异常的过程。通过案例分析,揭示了代码中涉及的数据访问控制、状态判断及错误处理等关键点。
4882

被折叠的 条评论
为什么被折叠?



