Navigation Menu

Skip to content

Commit

Permalink
JAVA_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
winterbe committed Mar 27, 2014
1 parent 43e1066 commit fab49b2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/com/winterbe/java8/explorer/FileParser.java
Expand Up @@ -16,6 +16,8 @@
*/
public class FileParser {

private static final String JAVA_VERSION = "1.8";

public Optional<TypeInfo> parse(File file, String path, Statistics statistics) throws IOException {
if (!file.exists()) {
throw new FileNotFoundException("file does not exist: " + file.getAbsolutePath());
Expand All @@ -39,7 +41,7 @@ private Optional<TypeInfo> getTypeInfo(Document document, String path, Statistic

Element body = document.body();

if (!body.html().contains("1.8")) {
if (!body.html().contains(JAVA_VERSION)) {
return Optional.empty();
}

Expand All @@ -61,7 +63,7 @@ private Optional<TypeInfo> getTypeInfo(Document document, String path, Statistic
boolean newType = false;
Elements elements1 = body.select(".contentContainer .description dd");
for (Element dd : elements1) {
if (dd.text().equals("1.8")) {
if (dd.text().equals(JAVA_VERSION)) {
newType = true;
break;
}
Expand Down Expand Up @@ -102,7 +104,7 @@ private Optional<TypeInfo> getTypeInfo(Document document, String path, Statistic
for (Element dd : dds) {
statistics.maxMembers++;

if (newType || dd.text().equals("1.8")) {
if (newType || dd.text().equals(JAVA_VERSION)) {
MemberInfo memberInfo = new MemberInfo();
memberInfo.setType(type);
memberInfo.setName(methodName);
Expand Down

0 comments on commit fab49b2

Please sign in to comment.