Skip to content

Commit

Permalink
Merge pull request #907 from caelum/issue_906
Browse files Browse the repository at this point in the history
removing result.used from forwardTo
  • Loading branch information
Turini committed Dec 18, 2014
2 parents dce4bfc + b630089 commit e3a4fb8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
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

0 comments on commit e3a4fb8

Please sign in to comment.