Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing result.used from forwardTo #907

Merged
merged 1 commit into from
Dec 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package br.com.caelum.vraptor.core;


import static br.com.caelum.vraptor.view.Results.logic;
import static java.util.Collections.unmodifiableMap;

import java.util.HashMap;
Expand Down Expand Up @@ -83,12 +82,6 @@ public <T extends View> T use(Class<T> view) {
return container.instanceFor(view);
}

@Override
public <T> T forwardTo(Class<T> controller) {
messages.assertAbsenceOfErrors();
return container.instanceFor(logic()).forwardTo(controller);
}

@Override
public Result on(Class<? extends Exception> exception) {
return exceptions.record(exception);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.slf4j.LoggerFactory;

import br.com.caelum.vraptor.Get;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.controller.ControllerMethod;
import br.com.caelum.vraptor.controller.DefaultControllerMethod;
import br.com.caelum.vraptor.controller.HttpMethod;
Expand Down Expand Up @@ -68,20 +67,18 @@ public class DefaultLogicResult implements LogicResult {
private final TypeNameExtractor extractor;
private final FlashScope flash;
private final MethodInfo methodInfo;
private final Result result;

/**
* @deprecated CDI eyes only
*/
protected DefaultLogicResult() {
this(null, null, null, null, null, null, null, null, null, null);
this(null, null, null, null, null, null, null, null, null);
}

@Inject
public DefaultLogicResult(Proxifier proxifier, Router router, MutableRequest request, HttpServletResponse response,
Container container, PathResolver resolver, TypeNameExtractor extractor, FlashScope flash, MethodInfo methodInfo, Result result) {
Container container, PathResolver resolver, TypeNameExtractor extractor, FlashScope flash, MethodInfo methodInfo) {
this.proxifier = proxifier;
this.result = result;
this.response = unproxifyIfPossible(response);
this.request = unproxifyIfPossible(request);
this.router = router;
Expand Down Expand Up @@ -115,7 +112,7 @@ public Object intercept(T proxy, Method method, Object[] args, SuperMethod super
request.setAttribute(extractor.nameFor(returnType), methodResult);
}

if (response.isCommitted() || result.used()) {
if (response.isCommitted()) {
logger.debug("Response already commited, not forwarding.");
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public class DefaultLogicResultTest {
private @Mock TypeNameExtractor extractor;
private @Mock RequestDispatcher dispatcher;
private @Mock FlashScope flash;
private @Mock Result result;

private Proxifier proxifier;

Expand Down Expand Up @@ -121,7 +120,7 @@ public void setup() {
proxifier = new JavassistProxifier();
methodInfo = new MethodInfo(new ParanamerNameProvider());
this.logicResult = new DefaultLogicResult(proxifier, router, request, response, container,
resolver, extractor, flash, methodInfo, result);
resolver, extractor, flash, methodInfo);
}

@Test
Expand Down