diff --git a/pdex/Todo, GSoC 2013.txt b/pdex/Todo, GSoC 2013.txt index 70980f35b..6268ef55f 100644 --- a/pdex/Todo, GSoC 2013.txt +++ b/pdex/Todo, GSoC 2013.txt @@ -71,6 +71,7 @@ Refactoring * Undo misbehaves here, handle carefully. +x Ordered list in 'Show Usage' window x Add support for word select on right click and rename, mouse co-ordinates need to obtained carefully Refactoring would work only when code is compiler error free. I plan to do a find replace type op on the compile ready code. diff --git a/pdex/src/processing/mode/experimental/ErrorCheckerService.java b/pdex/src/processing/mode/experimental/ErrorCheckerService.java index 1508412ba..e1dd641dc 100644 --- a/pdex/src/processing/mode/experimental/ErrorCheckerService.java +++ b/pdex/src/processing/mode/experimental/ErrorCheckerService.java @@ -10,6 +10,7 @@ import java.net.URLClassLoader; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -187,7 +188,7 @@ public class ErrorCheckerService implements Runnable{ defaultImportsOffset = pdePrepoc.getCoreImports().length + pdePrepoc.getDefaultImports().length + 1; astGenerator = new ASTGenerator(this); - syntaxErrors = true; + syntaxErrors = new AtomicBoolean(true); errorMsgSimplifier = new ErrorMessageSimplifier(); } @@ -340,13 +341,14 @@ public class ErrorCheckerService implements Runnable{ return false; } - private boolean syntaxErrors; + private AtomicBoolean syntaxErrors; public boolean hasSyntaxErrors(){ - return syntaxErrors; + return syntaxErrors.get(); } private void syntaxCheck() { + syntaxErrors.set(true); parser.setSource(sourceCode.toCharArray()); parser.setKind(ASTParser.K_COMPILATION_UNIT); @@ -376,7 +378,10 @@ public class ErrorCheckerService implements Runnable{ // System.out.println(p.toString()); } - syntaxErrors = problems.length == 0 ? false : true; + if (problems.length == 0) + syntaxErrors.set(false); + else + syntaxErrors.set(true); } protected URLClassLoader classLoader; private void compileCheck() {