less printing

This commit is contained in:
Julian Dolby 2013-12-03 15:59:18 -05:00
parent 62729613d7
commit 1b81d2ffcd
3 changed files with 19 additions and 9 deletions

View File

@ -13,6 +13,10 @@ import org.junit.Test;
public class JDTJava15IRTests extends JDTJavaTest {
static {
System.setProperty("wala.jdt.quiet", "true");
}
public JDTJava15IRTests() {
super(JDTJavaIRTests.PROJECT);
}

View File

@ -46,6 +46,10 @@ import com.ibm.wala.ide.tests.util.EclipseTestUtil.ZippedProjectData;
public class JDTJavaIRTests extends JavaIRTests {
static {
System.setProperty("wala.jdt.quiet", "true");
}
public static final String PROJECT_NAME = "com.ibm.wala.cast.java.test.data";
public static final String PROJECT_ZIP = "test_project.zip";

View File

@ -149,16 +149,18 @@ public class JDTSourceModuleTranslator implements SourceModuleTranslator {
e.printStackTrace();
}
IProblem[] problems = ast.getProblems();
int length = problems.length;
if (length > 0) {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < length; i++) {
buffer.append(problems[i].getMessage());
buffer.append('\n');
if (! System.getProperty("wala.jdt.quiet").equals("true")) {
IProblem[] problems = ast.getProblems();
int length = problems.length;
if (length > 0) {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < length; i++) {
buffer.append(problems[i].getMessage());
buffer.append('\n');
}
if (length != 0)
System.err.println("Unexpected problems in " + source.getElementName() + buffer.toString());
}
if (length != 0)
System.err.println("Unexpected problems in " + source.getElementName() + buffer.toString());
}
}
}, null);