diff --git a/build.xml b/build.xml
index dd3193b59..2a80fddfb 100644
--- a/build.xml
+++ b/build.xml
@@ -85,7 +85,7 @@
-
+
@@ -175,15 +175,18 @@
-
+
+
+
+
@@ -198,6 +201,7 @@
+
@@ -212,6 +216,7 @@
+
@@ -226,13 +231,14 @@
+
-
+
@@ -240,6 +246,7 @@
+
@@ -253,6 +260,7 @@
+
@@ -266,6 +274,7 @@
+
@@ -279,6 +288,7 @@
+
@@ -289,6 +299,7 @@
+
@@ -299,6 +310,7 @@
+
@@ -312,6 +324,7 @@
+
@@ -322,6 +335,7 @@
+
@@ -332,6 +346,7 @@
+
@@ -346,6 +361,7 @@
+
@@ -369,13 +385,8 @@
-
-
-
-
-
-
+
@@ -390,6 +401,13 @@
+
+
+
+
+
+
+
@@ -415,7 +433,7 @@
-
+
diff --git a/src/java/boa/datagen/util/ProtoMessageVisitor.java b/src/test/boa/test/datagen/ProtoMessageVisitor.java
similarity index 98%
rename from src/java/boa/datagen/util/ProtoMessageVisitor.java
rename to src/test/boa/test/datagen/ProtoMessageVisitor.java
index 1be0c409f..640e6ac1d 100644
--- a/src/java/boa/datagen/util/ProtoMessageVisitor.java
+++ b/src/test/boa/test/datagen/ProtoMessageVisitor.java
@@ -1,4 +1,4 @@
-package boa.datagen.util;
+package boa.test.datagen;
import java.util.Iterator;
import java.util.List;
diff --git a/src/test/boa/test/datagen/TestSequenceFile.java b/src/test/boa/test/datagen/TestSequenceFile.java
index 980604863..eb7406dce 100644
--- a/src/test/boa/test/datagen/TestSequenceFile.java
+++ b/src/test/boa/test/datagen/TestSequenceFile.java
@@ -27,7 +27,6 @@
import boa.datagen.BoaGenerator;
import boa.datagen.DefaultProperties;
import boa.datagen.util.FileIO;
-import boa.datagen.util.ProtoMessageVisitor;
import boa.functions.BoaIntrinsics;
import boa.test.datagen.java.Java8BaseTest;
import boa.types.Ast.ASTRoot;
diff --git a/src/test/boa/test/datagen/TestTypeFullyQualifiedName.java b/src/test/boa/test/datagen/TestTypeFullyQualifiedName.java
index 6585cb01e..1a3f48389 100644
--- a/src/test/boa/test/datagen/TestTypeFullyQualifiedName.java
+++ b/src/test/boa/test/datagen/TestTypeFullyQualifiedName.java
@@ -14,7 +14,7 @@
import com.google.protobuf.CodedInputStream;
import com.google.protobuf.Message;
-import boa.datagen.util.ProtoMessageVisitor;
+
import boa.types.Ast.ASTRoot;
import boa.types.Ast.Declaration;
import boa.types.Ast.Expression;
diff --git a/src/test/boa/test/datagen/ASTDumper.java b/src/test/boa/test/datagen/java/ASTDumper.java
similarity index 99%
rename from src/test/boa/test/datagen/ASTDumper.java
rename to src/test/boa/test/datagen/java/ASTDumper.java
index 8a49a5463..a7e2ef79c 100644
--- a/src/test/boa/test/datagen/ASTDumper.java
+++ b/src/test/boa/test/datagen/java/ASTDumper.java
@@ -13,7 +13,7 @@
// is preserved, and any changes are properly documented.
//
-package boa.test.datagen;
+package boa.test.datagen.java;
import java.util.ArrayList;
import java.util.Iterator;
diff --git a/src/test/boa/test/datagen/java/DumpJava.java b/src/test/boa/test/datagen/java/DumpJava.java
index 573859ab8..f2d3c5788 100644
--- a/src/test/boa/test/datagen/java/DumpJava.java
+++ b/src/test/boa/test/datagen/java/DumpJava.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017, Robert Dyer,
+ * Copyright 2017, Robert Dyer,
* and Bowling Green State University
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/src/test/boa/test/datagen/IASTPrinter.java b/src/test/boa/test/datagen/java/IASTPrinter.java
similarity index 98%
rename from src/test/boa/test/datagen/IASTPrinter.java
rename to src/test/boa/test/datagen/java/IASTPrinter.java
index 6fe02d027..6104fcb88 100644
--- a/src/test/boa/test/datagen/IASTPrinter.java
+++ b/src/test/boa/test/datagen/java/IASTPrinter.java
@@ -13,7 +13,7 @@
// is preserved, and any changes are properly documented.
//
-package boa.test.datagen;
+package boa.test.datagen.java;
/**
* SAX-style printer for outputting AST nodes.
diff --git a/src/test/boa/test/datagen/ICommentsExtractor.java b/src/test/boa/test/datagen/java/ICommentsExtractor.java
similarity index 97%
rename from src/test/boa/test/datagen/ICommentsExtractor.java
rename to src/test/boa/test/datagen/java/ICommentsExtractor.java
index a688786b8..95f761133 100644
--- a/src/test/boa/test/datagen/ICommentsExtractor.java
+++ b/src/test/boa/test/datagen/java/ICommentsExtractor.java
@@ -13,7 +13,7 @@
// is preserved, and any changes are properly documented.
//
-package boa.test.datagen;
+package boa.test.datagen.java;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.Comment;
diff --git a/src/test/boa/test/datagen/Indenter.java b/src/test/boa/test/datagen/java/Indenter.java
similarity index 97%
rename from src/test/boa/test/datagen/Indenter.java
rename to src/test/boa/test/datagen/java/Indenter.java
index 85fd60b24..df7156eb6 100644
--- a/src/test/boa/test/datagen/Indenter.java
+++ b/src/test/boa/test/datagen/java/Indenter.java
@@ -13,7 +13,7 @@
// is preserved, and any changes are properly documented.
//
-package boa.test.datagen;
+package boa.test.datagen.java;
/**
* Maintains an indentation string.
diff --git a/src/test/boa/test/datagen/JSONStyleASTPrinter.java b/src/test/boa/test/datagen/java/JSONStyleASTPrinter.java
similarity index 99%
rename from src/test/boa/test/datagen/JSONStyleASTPrinter.java
rename to src/test/boa/test/datagen/java/JSONStyleASTPrinter.java
index c449b4b3f..46ba9f8e5 100644
--- a/src/test/boa/test/datagen/JSONStyleASTPrinter.java
+++ b/src/test/boa/test/datagen/java/JSONStyleASTPrinter.java
@@ -13,7 +13,7 @@
// is preserved, and any changes are properly documented.
//
-package boa.test.datagen;
+package boa.test.datagen.java;
import java.io.OutputStream;
import java.io.PrintWriter;
diff --git a/src/test/boa/test/datagen/java/Java7BaseTest.java b/src/test/boa/test/datagen/java/Java7BaseTest.java
index a93437775..db87aad40 100644
--- a/src/test/boa/test/datagen/java/Java7BaseTest.java
+++ b/src/test/boa/test/datagen/java/Java7BaseTest.java
@@ -46,10 +46,8 @@
import boa.types.Diff.ChangedFile;
import boa.datagen.util.FileIO;
import boa.datagen.util.JavaVisitor;
-import boa.datagen.util.ProtoMessageVisitor;
import boa.test.compiler.BaseTest;
-import boa.test.datagen.ASTDumper;
-import boa.test.datagen.UglyMathCommentsExtractor;
+import boa.test.datagen.ProtoMessageVisitor;
/*
* @author rdyer
@@ -98,13 +96,13 @@ public void acceptAST(String sourceFilePath, CompilationUnit cu) {
sb.append(JsonFormat.printToString(ast.build()));
}
};
- Map fileContents = new HashMap();
+ final Map fileContents = new HashMap();
fileContents.put("", content);
@SuppressWarnings("rawtypes")
- Map options = JavaCore.getOptions();
+ final Map options = JavaCore.getOptions();
options.put(JavaCore.COMPILER_COMPLIANCE, javaVersion);
options.put(JavaCore.COMPILER_SOURCE, javaVersion);
- ASTParser parser = ASTParser.newParser(astLevel);
+ final ASTParser parser = ASTParser.newParser(astLevel);
parser.setCompilerOptions(options);
parser.setEnvironment(new String[0], new String[]{}, new String[]{}, true);
parser.setResolveBindings(true);
@@ -167,20 +165,20 @@ protected static Declaration getDeclaration(final SequenceFile.Reader ar, final
if (cf.getAst() && astpos > -1) {
try {
ar.seek(astpos);
- Writable astkey = new LongWritable();
- BytesWritable val = new BytesWritable();
+ final Writable astkey = new LongWritable();
+ final BytesWritable val = new BytesWritable();
ar.next(astkey, val);
- byte[] bytes = val.getBytes();
- ASTRoot root = ASTRoot.parseFrom(CodedInputStream.newInstance(bytes, 0, val.getLength()));
- ProtoMessageVisitor v = new ProtoMessageVisitor() {
+ final byte[] bytes = val.getBytes();
+ final ASTRoot root = ASTRoot.parseFrom(CodedInputStream.newInstance(bytes, 0, val.getLength()));
+ final ProtoMessageVisitor v = new ProtoMessageVisitor() {
private boolean found = false;
@Override
- public boolean preVisit(Message message) {
+ public boolean preVisit(final Message message) {
if (found)
return false;
if (message instanceof Declaration) {
- Declaration temp = (Declaration) message;
+ final Declaration temp = (Declaration) message;
Declaration type = declarations.get(temp.getKey());
if (type == null) {
type = Declaration.newBuilder(temp).build();
@@ -195,7 +193,7 @@ public boolean preVisit(Message message) {
};
};
v.visit(root);
- } catch (IOException e) {}
+ } catch (final IOException e) {}
}
return declarations.get(nodeId);
}
@@ -205,27 +203,27 @@ protected static Message getMessage(final SequenceFile.Reader ar, final ChangedF
if (cf.getAst() && astpos > -1) {
try {
ar.seek(astpos);
- Writable astkey = new LongWritable();
- BytesWritable val = new BytesWritable();
+ final Writable astkey = new LongWritable();
+ final BytesWritable val = new BytesWritable();
ar.next(astkey, val);
- byte[] bytes = val.getBytes();
- ASTRoot root = ASTRoot.parseFrom(CodedInputStream.newInstance(bytes, 0, val.getLength()));
+ final byte[] bytes = val.getBytes();
+ final ASTRoot root = ASTRoot.parseFrom(CodedInputStream.newInstance(bytes, 0, val.getLength()));
return getMessage(root, nodeId);
- } catch (IOException e) {}
+ } catch (final IOException e) {}
}
return null;
}
protected static Message getMessage(final Message root, final int nodeId) {
final Message[] m = new Message[1];
- ProtoMessageVisitor v = new ProtoMessageVisitor() {
+ final ProtoMessageVisitor v = new ProtoMessageVisitor() {
private boolean found = false;
@Override
- public boolean preVisit(Message message) {
+ public boolean preVisit(final Message message) {
if (found)
return false;
- Object v = getFieldValue(message, "key");
+ final Object v = getFieldValue(message, "key");
if (v != null && (Integer) v == nodeId) {
m[0] = message;
found = true;
@@ -238,9 +236,9 @@ public boolean preVisit(Message message) {
return m[0];
}
- protected static Object getFieldValue(Message message, String name) {
- for (Iterator> iter = message.getAllFields().entrySet().iterator(); iter.hasNext();) {
- Map.Entry field = iter.next();
+ protected static Object getFieldValue(final Message message, final String name) {
+ for (final Iterator> iter = message.getAllFields().entrySet().iterator(); iter.hasNext();) {
+ final Map.Entry field = iter.next();
if (field.getKey().getName().equals(name)) {
return field.getValue();
}
@@ -249,43 +247,43 @@ protected static Object getFieldValue(Message message, String name) {
}
protected static HashMap> collectDeclarations(final SequenceFile.Reader ar, List snapshot) throws IOException {
- HashMap> fileNodeDeclaration = new HashMap>();
+ final HashMap> fileNodeDeclaration = new HashMap>();
for (int fileIndex = 0; fileIndex < snapshot.size(); fileIndex++) {
- ChangedFile cf = snapshot.get(fileIndex);
+ final ChangedFile cf = snapshot.get(fileIndex);
long astpos = cf.getKey();
if (!cf.getAst())
continue;
if (astpos > -1) {
ar.seek(astpos);
- Writable astkey = new LongWritable();
- BytesWritable val = new BytesWritable();
+ final Writable astkey = new LongWritable();
+ final BytesWritable val = new BytesWritable();
ar.next(astkey, val);
- byte[] bytes = val.getBytes();
- ASTRoot root = ASTRoot.parseFrom(CodedInputStream.newInstance(bytes, 0, val.getLength()));
- HashMap nodeDeclaration = collectDeclarations(root);
+ final byte[] bytes = val.getBytes();
+ final ASTRoot root = ASTRoot.parseFrom(CodedInputStream.newInstance(bytes, 0, val.getLength()));
+ final HashMap nodeDeclaration = collectDeclarations(root);
fileNodeDeclaration.put(fileIndex, nodeDeclaration);
}
}
return fileNodeDeclaration;
}
- protected static HashMap collectDeclarations(Message message) {
- HashMap nodeDeclaration = new HashMap();
+ protected static HashMap collectDeclarations(final Message message) {
+ final HashMap nodeDeclaration = new HashMap();
if (message instanceof Declaration) {
nodeDeclaration.put(((Declaration) message).getKey(), (Declaration) message);
}
- for (Iterator> iter = message.getAllFields().entrySet().iterator(); iter.hasNext();) {
- Map.Entry field = iter.next();
+ for (final Iterator> iter = message.getAllFields().entrySet().iterator(); iter.hasNext();) {
+ final Map.Entry field = iter.next();
nodeDeclaration.putAll(collectDeclarations(field.getKey(), field.getValue()));
}
return nodeDeclaration;
}
- protected static HashMap collectDeclarations(FieldDescriptor field, Object value) {
- HashMap nodeDeclaration = new HashMap();
+ protected static HashMap collectDeclarations(final FieldDescriptor field, final Object value) {
+ final HashMap nodeDeclaration = new HashMap();
if (field.isRepeated()) {
// Repeated field. Print each element.
- for (Iterator> iter = ((List>) value).iterator(); iter.hasNext();)
+ for (final Iterator> iter = ((List>) value).iterator(); iter.hasNext();)
if (field.getType() == Type.MESSAGE)
nodeDeclaration.putAll(collectDeclarations((Message) iter.next()));
}
diff --git a/src/test/boa/test/datagen/java/Java8BaseTest.java b/src/test/boa/test/datagen/java/Java8BaseTest.java
index 1e28ca408..ef914c9c4 100644
--- a/src/test/boa/test/datagen/java/Java8BaseTest.java
+++ b/src/test/boa/test/datagen/java/Java8BaseTest.java
@@ -35,7 +35,7 @@ private static void setJava8() {
public static void dumpJavaWrapped(final String content) {
setJava8();
Java7BaseTest.dumpJavaWrapped(content);
- }
+ }
public static void dumpJava(final String content) {
setJava8();
diff --git a/src/test/boa/test/datagen/java/JavaToBoa.java b/src/test/boa/test/datagen/java/JavaToBoa.java
index 18282b234..3f77c0f4c 100644
--- a/src/test/boa/test/datagen/java/JavaToBoa.java
+++ b/src/test/boa/test/datagen/java/JavaToBoa.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016, Hridesh Rajan, Robert Dyer,
+ * Copyright 2016, Hridesh Rajan, Robert Dyer,
* Iowa State University of Science and Technology,
* and Bowling Green State University
*
@@ -21,7 +21,7 @@
* @author rdyer
*/
public class JavaToBoa extends Java8BaseTest {
- public static void main(String[] args) {
+ public static void main(final String[] args) {
for (final String s : args)
if (s.indexOf("class ") == -1)
System.out.println(parseWrapped(s));
diff --git a/src/test/boa/test/datagen/java/TestJLSVersion.java b/src/test/boa/test/datagen/java/TestJLSVersion.java
index be679d8b5..f2563f9fb 100644
--- a/src/test/boa/test/datagen/java/TestJLSVersion.java
+++ b/src/test/boa/test/datagen/java/TestJLSVersion.java
@@ -43,31 +43,30 @@
@RunWith(Parameterized.class)
public class TestJLSVersion {
-
- @Parameters(name = "{index}: {0}")
- public static List