How can I detect static analysis if a project uses Java8?

I am currently using javaparser ( https://github.com/javaparser/javaparser ) and javasymbolsolver ( https://github.com/javaparser/javasymbolsolver ) to parse the code. Will this be a holistic approach if I discover the use of Collections # Streams to decide that a particular project has migrated to Java8. (Assuming Collection # Streams is the most widely used java8 function).

+4
source share
2 answers

I see several approaches here, both source and binary, looking for the Java 8 API and looking for Java 8 features.

Look for Java 8 APIs

Look for regular Java 8 APIs in source code (simple)

You can parse the code and look for the APIs first introduced in Java 8 - as you suggested in your answer. The most common features of the Java 8 API are threads and a class Optional, as well as a package java.util.function. I would expect almost any project that switched to Java 8 to use these features.

Look for all Java 8 APIs in source code (advanced)

100%, API Java 8 , , API, Java 8. , , Sigtest, API ( Java).

, , . .class , . , , . ClassDep ( Apache River, ).

, . Java 7 51.0, Java 8 - 52.0, Java 9 - 53.0. javap, JDK, -v.

Java 8

, , Java 8. , Java 8, lambdas . (, , ) Java 8 .

. " Java 8 ?" 100% . , , , Java 8 API, API Java 8, Java 7.

" 8 ?" - , lambdas, 52.0, .

" API Java 8?", , . , API- - , , , - , .

+2

Java8.

[, !] Java7 Java8 , . ( Java vN ).

, , .

, - (, Java8).

, ; , - Java8 . , , .

+3

Source: https://habr.com/ru/post/1664204/


All Articles