Skip to content

Commit 5626331

Browse files
committed
PDEX + PPS: remove unnecessary problem list
1 parent e8e6558 commit 5626331

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

java/src/processing/mode/java/pdex/PDEX.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,8 @@ public void dispose() {
876876

877877
private void handleSketchProblems(PreprocessedSketch ps) {
878878
// Process problems
879-
final List<Problem> problems = ps.problems.stream()
879+
IProblem[] iproblems = ps.compilationUnit.getProblems();
880+
final List<Problem> problems = Arrays.stream(iproblems)
880881
// Filter Warnings if they are not enabled
881882
.filter(iproblem -> !(iproblem.isWarning() && !JavaMode.warningsEnabled))
882883
// Hide a useless error which is produced when a line ends with

java/src/processing/mode/java/pdex/PreprocessedSketch.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.google.classpath.ClassPath;
44

5-
import org.eclipse.jdt.core.compiler.IProblem;
65
import org.eclipse.jdt.core.dom.ASTNode;
76
import org.eclipse.jdt.core.dom.CompilationUnit;
87

@@ -38,8 +37,6 @@ public class PreprocessedSketch {
3837
public final boolean hasSyntaxErrors;
3938
public final boolean hasCompilationErrors;
4039

41-
public final List<IProblem> problems;
42-
4340
public final List<ImportStatement> programImports;
4441
public final List<ImportStatement> coreAndDefaultImports;
4542
public final List<ImportStatement> codeFolderImports;
@@ -218,8 +215,6 @@ public static class Builder {
218215
public boolean hasSyntaxErrors;
219216
public boolean hasCompilationErrors;
220217

221-
public List<IProblem> problems = new ArrayList<>();
222-
223218
public final List<ImportStatement> programImports = new ArrayList<>();
224219
public final List<ImportStatement> coreAndDefaultImports = new ArrayList<>();
225220
public final List<ImportStatement> codeFolderImports = new ArrayList<>();
@@ -254,8 +249,6 @@ private PreprocessedSketch(Builder b) {
254249
hasSyntaxErrors = b.hasSyntaxErrors;
255250
hasCompilationErrors = b.hasCompilationErrors;
256251

257-
problems = Collections.unmodifiableList(b.problems);
258-
259252
programImports = Collections.unmodifiableList(b.programImports);
260253
coreAndDefaultImports = Collections.unmodifiableList(b.coreAndDefaultImports);
261254
codeFolderImports = Collections.unmodifiableList(b.codeFolderImports);

java/src/processing/mode/java/pdex/PreprocessingService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ private PreprocessedSketch preprocessSketch(PreprocessedSketch prevResult) {
412412

413413
// Get compilation problems
414414
List<IProblem> bindingsProblems = Arrays.asList(bindingsCU.getProblems());
415-
result.problems.addAll(bindingsProblems);
416415
result.hasCompilationErrors = bindingsProblems.stream()
417416
.anyMatch(IProblem::isError);
418417

0 commit comments

Comments
 (0)