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

Support for java.util.stream library #302

Closed
cyrille-artho opened this issue Nov 22, 2021 · 9 comments
Closed

Support for java.util.stream library #302

cyrille-artho opened this issue Nov 22, 2021 · 9 comments
Assignees

Comments

@cyrille-artho
Copy link
Member

cyrille-artho commented Nov 22, 2021

Java 8 has introduced a new library to deal with large data structures, Java Streams:

https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html

We don't have any unit tests for the new Java streams collections (java.util.stream), and thus we don't know how well JPF handles them (if at all).
A few examples (unit tests) would be helpful to see if JPF can handle these cases at all (there may be missing native peer classes/methods), and what problems there might be.

@gaurangkudale
Copy link
Contributor

I'll look into this issue and also create some unit tests for this issue to check whether it's working or not till then can you please assign this issue to me so that I'll start working on it

@gaurangkudale
Copy link
Contributor

Do I only need to create unit test for the java.util.stream is that right?

@cyrille-artho
Copy link
Member Author

You can start with a test that builds a stream pipeline for one of the data structures in that package (e.g., IntStream) and creates a stream that does something useful.
You can adapt existing open-source code as a simple unit test as long as the license of the existing code is compatible with the license of JPF (ideally, having the Apache License v2), or you can create your own example and provide it to the JPF project under the Apache License.
The task is quite open-ended at the beginning: create a small example that runs on the normal JVM and produces a meaningful result, and then see what happens inside JPF.
Ideally, the example is less than 20 lines of code (plus import statements).

@gaurangkudale
Copy link
Contributor

Okay got it

@gaurangkudale
Copy link
Contributor

Hi @cyrille-artho
I've added the unit test example of IntStream and created the pull request

@achintya-7
Copy link

Is there requirement for more unit tests. I am just asking because this issue is still open.

@cyrille-artho
Copy link
Member Author

Guarang's work is in progress and close to finished. It seems that the streams library (at least for the common function) uses no native code and likely works as expected for simple cases.
This means we do not need additional unit tests for Java streams right now. Unit tests are very welcome for other parts of Java's libraries, especially if they help to narrow down the reason for compatibility problems with Java 11+.
So if you look at issue #274 and can find a way to write a unit test that is simpler than one of the existing tests and still shows the same type of problem, that will be very useful to find a bug fix.

@achintya-7
Copy link

achintya-7 commented Jan 13, 2022

Sure, I'll look into it.

@cyrille-artho
Copy link
Member Author

Addressed by PR #305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants