@Test public void testGetComposeStackNull() { Request request = createMock(Request.class); Map<String, Object> requestScope = new HashMap<String, Object>(); expect(request.getContext("request")).andReturn(requestScope); replay(request); assertSame(ComposeStackUtil.getComposeStack(request), requestScope.get(ComposeStackUtil.COMPOSE_STACK_ATTRIBUTE_NAME)); verify(request); }
@SuppressWarnings("unchecked") public static Deque<Object> getComposeStack(Request request) { Map<String, Object> requestScope = request.getContext("request"); Deque<Object> composeStack = (Deque<Object>) requestScope .get(COMPOSE_STACK_ATTRIBUTE_NAME); if (composeStack == null) { composeStack = new LinkedList<Object>(); requestScope.put(ComposeStackUtil.COMPOSE_STACK_ATTRIBUTE_NAME, composeStack); } return composeStack; }
ComposeStackUtil { @SuppressWarnings("unchecked") public static Deque<Object> getComposeStack(Request request) { Map<String, Object> requestScope = request.getContext("request"); Deque<Object> composeStack = (Deque<Object>) requestScope .get(COMPOSE_STACK_ATTRIBUTE_NAME); if (composeStack == null) { composeStack = new LinkedList<Object>(); requestScope.put(ComposeStackUtil.COMPOSE_STACK_ATTRIBUTE_NAME, composeStack); } return composeStack; } }
ComposeStackUtil { @SuppressWarnings("unchecked") public static Deque<Object> getComposeStack(Request request) { Map<String, Object> requestScope = request.getContext("request"); Deque<Object> composeStack = (Deque<Object>) requestScope .get(COMPOSE_STACK_ATTRIBUTE_NAME); if (composeStack == null) { composeStack = new LinkedList<Object>(); requestScope.put(ComposeStackUtil.COMPOSE_STACK_ATTRIBUTE_NAME, composeStack); } return composeStack; } private  ComposeStackUtil(); }
ComposeStackUtil { @SuppressWarnings("unchecked") public static Deque<Object> getComposeStack(Request request) { Map<String, Object> requestScope = request.getContext("request"); Deque<Object> composeStack = (Deque<Object>) requestScope .get(COMPOSE_STACK_ATTRIBUTE_NAME); if (composeStack == null) { composeStack = new LinkedList<Object>(); requestScope.put(ComposeStackUtil.COMPOSE_STACK_ATTRIBUTE_NAME, composeStack); } return composeStack; } private  ComposeStackUtil(); static Object findAncestorWithClass(Deque<Object> composeStack, Class<?> clazz); @SuppressWarnings("unchecked") static Deque<Object> getComposeStack(Request request); }
ComposeStackUtil { @SuppressWarnings("unchecked") public static Deque<Object> getComposeStack(Request request) { Map<String, Object> requestScope = request.getContext("request"); Deque<Object> composeStack = (Deque<Object>) requestScope .get(COMPOSE_STACK_ATTRIBUTE_NAME); if (composeStack == null) { composeStack = new LinkedList<Object>(); requestScope.put(ComposeStackUtil.COMPOSE_STACK_ATTRIBUTE_NAME, composeStack); } return composeStack; } private  ComposeStackUtil(); static Object findAncestorWithClass(Deque<Object> composeStack, Class<?> clazz); @SuppressWarnings("unchecked") static Deque<Object> getComposeStack(Request request); static final String COMPOSE_STACK_ATTRIBUTE_NAME; }