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

Java 8 compatibility #216

Closed
arbach opened this Issue Dec 16, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@arbach

arbach commented Dec 16, 2016

If I add this line
list.sort(Comparator.comparing( a -> ..

where list is

List<Object>

the whole controller disappears from the docs. Not sure if this is something I am doing wrong ..

@ST-DDT

This comment has been minimized.

Show comment
Hide comment
@ST-DDT

ST-DDT Feb 28, 2017

Can you create a complete class/method that showcases the issue?

ST-DDT commented Feb 28, 2017

Can you create a complete class/method that showcases the issue?

@arbach

This comment has been minimized.

Show comment
Hide comment
@arbach

arbach Jul 8, 2017

This class will not show in the documentation. It will show up if you comment the filter line.

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.security.RolesAllowed;
import org.jsondoc.core.annotation.Api;
import org.jsondoc.core.annotation.ApiAuthToken;
import org.jsondoc.core.annotation.ApiMethod;
import org.jsondoc.core.pojo.ApiStage;
import org.jsondoc.core.pojo.ApiVisibility;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Api(name = "/stream", description = "Stream issue demo", group = "demo", visibility = ApiVisibility.PRIVATE, stage = ApiStage.RC)
@ApiAuthToken(roles = "USER", scheme = "Bearer")
@controller
@RequestMapping(value = "/api")
public class StreamTest {

@RolesAllowed({"ROLE_USER"})
@ApiMethod(description = "demo")
@RequestMapping(value = "/demo", method = RequestMethod.GET)
protected @ResponseBody
Object inputsGet() throws Exception {
    List<String>test = new ArrayList<>();
    test.add("x"); 

// comment the following line
test.stream().filter( i -> i == "x").collect(Collectors.toList());
return "done";
}

}

arbach commented Jul 8, 2017

This class will not show in the documentation. It will show up if you comment the filter line.

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.security.RolesAllowed;
import org.jsondoc.core.annotation.Api;
import org.jsondoc.core.annotation.ApiAuthToken;
import org.jsondoc.core.annotation.ApiMethod;
import org.jsondoc.core.pojo.ApiStage;
import org.jsondoc.core.pojo.ApiVisibility;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Api(name = "/stream", description = "Stream issue demo", group = "demo", visibility = ApiVisibility.PRIVATE, stage = ApiStage.RC)
@ApiAuthToken(roles = "USER", scheme = "Bearer")
@controller
@RequestMapping(value = "/api")
public class StreamTest {

@RolesAllowed({"ROLE_USER"})
@ApiMethod(description = "demo")
@RequestMapping(value = "/demo", method = RequestMethod.GET)
protected @ResponseBody
Object inputsGet() throws Exception {
    List<String>test = new ArrayList<>();
    test.add("x"); 

// comment the following line
test.stream().filter( i -> i == "x").collect(Collectors.toList());
return "done";
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment