diff --git a/java/src/processing/mode/java/pdex/ASTGenerator.java b/java/src/processing/mode/java/pdex/ASTGenerator.java index a1ff08b54..5368765e6 100644 --- a/java/src/processing/mode/java/pdex/ASTGenerator.java +++ b/java/src/processing/mode/java/pdex/ASTGenerator.java @@ -342,7 +342,7 @@ public class ASTGenerator { } jdocMap.put(methodName, msg); } - System.out.println("JDoc loaded " + jdocMap.size()); + //System.out.println("JDoc loaded " + jdocMap.size()); } @@ -1522,7 +1522,7 @@ public class ASTGenerator { } else if (parent instanceof Block) { nodes = ((Block) parent).statements(); } else { - System.err.println("findClosestNode() found " + getNodeAsString(parent)); + log("findClosestNode() found " + getNodeAsString(parent)); return null; } diff --git a/java/src/processing/mode/java/pdex/ErrorCheckerService.java b/java/src/processing/mode/java/pdex/ErrorCheckerService.java index 524733530..5cbea9d0f 100644 --- a/java/src/processing/mode/java/pdex/ErrorCheckerService.java +++ b/java/src/processing/mode/java/pdex/ErrorCheckerService.java @@ -112,12 +112,12 @@ public class ErrorCheckerService { /** * URLs of extra imports jar files stored here. */ - protected URL[] classPath; + protected URL[] classPath = {}; /** - * Stores all Problems in the sketch + * Class loader used by compiler check and ASTGenerator, based on classPath */ - //public List problemsList; + protected URLClassLoader classLoader = new URLClassLoader(classPath); /** * How many lines are present till the initial class declaration? In static @@ -165,6 +165,11 @@ public class ErrorCheckerService { */ protected final XQPreprocessor xqpreproc; + /** + * ASTGenerator for operations on AST + */ + protected final ASTGenerator astGenerator; + /** * Regexp for import statements. (Used from Processing source) */ @@ -180,10 +185,11 @@ public class ErrorCheckerService { /** * Error checking doesn't happen before this interval has ellapsed since the - * last runManualErrorCheck() call. + * last request() call. */ private final static long errorCheckInterval = 650; + protected volatile CodeCheckResult lastCodeCheckResult = new CodeCheckResult(); private Thread errorCheckerThread; private final BlockingQueue requestQueue = new ArrayBlockingQueue<>(1); @@ -286,6 +292,7 @@ public class ErrorCheckerService { errorCheckerThread.start(); } + public void stop() { cancel(); running = false; @@ -332,8 +339,6 @@ public class ErrorCheckerService { } - protected final ASTGenerator astGenerator; - public ASTGenerator getASTGenerator() { return astGenerator; } @@ -488,8 +493,6 @@ public class ErrorCheckerService { return result; } - protected volatile CodeCheckResult lastCodeCheckResult = new CodeCheckResult(); - public boolean hasSyntaxErrors(){ return lastCodeCheckResult.syntaxErrors; } @@ -498,8 +501,6 @@ public class ErrorCheckerService { return lastCodeCheckResult.containsErrors; } - protected URLClassLoader classLoader; - /** * Performs compiler error check. * @param sourceName - name of the class