diff --git a/src/be/jeffcheasey88/peeratcode/parser/java/JavaParser.java b/src/be/jeffcheasey88/peeratcode/parser/java/JavaParser.java index 17309d3..16eff31 100644 --- a/src/be/jeffcheasey88/peeratcode/parser/java/JavaParser.java +++ b/src/be/jeffcheasey88/peeratcode/parser/java/JavaParser.java @@ -45,7 +45,7 @@ public class JavaParser extends Parser { longCommentary = false; i++; } - System.out.print(c); +// System.out.print(c); continue; } Token token; @@ -683,8 +683,8 @@ public class JavaParser extends Parser { StateTree clazz_implement = clazz_base.then((validator) -> validator.validate((token) -> token.getValue().equals("implements"))); StateTree clazz_implement_name = clazz_implement.then(new RedirectStateTree<>(type, (global, local) -> { Token token = global.get("implement"); - if(token == null) token = local.get(); - else token = token.concat(local.get()); +// if(token == null) token = local.get(); +// else token = token.concat(local.get()); global.set("implement", token); })); clazz_implement_name.then((validator) -> validator.validate((token) -> token.getValue().equals(","))).then(clazz_implement_name); diff --git a/test/GlobalCover.java b/test/GlobalCover.java index e10c744..9b96fc4 100644 --- a/test/GlobalCover.java +++ b/test/GlobalCover.java @@ -19,7 +19,7 @@ class GlobalCover { } void workspace() throws Exception{ - List files = files(new File("C:\\Users\\jeffc\\eclipse-workspace")); + List files = load(new File("workspaces.txt")); long validated = 0; long tokens = 0; int count = 0; @@ -31,6 +31,7 @@ class GlobalCover { long time = System.currentTimeMillis(); for(File file : files){ if(file.getName().endsWith(".java")){ + System.out.println("try "+file.getAbsolutePath()); BufferedReader reader = new BufferedReader(new FileReader(file)); parser.parse(reader, new JavaFile()); reader.close(); @@ -43,7 +44,7 @@ class GlobalCover { validated += TokenValidator.MAX_VALIDATE; tokens += TokenValidator.TOKENS; - System.out.println(file+" "+validated+" / "+tokens); + System.out.println(validated+" / "+tokens); TokenValidator.MAX_VALIDATE = 0; TokenValidator.TOKENS = 0; count++; @@ -60,6 +61,22 @@ class GlobalCover { writer.close(); } + private List load(File config) throws Exception{ + System.out.println("loading "+config.getAbsolutePath()); + BufferedReader reader = new BufferedReader(new FileReader(config)); + List workspaces = new ArrayList<>(); + String line; + while((line = reader.readLine()) != null) workspaces.add(new File(line)); + reader.close(); + System.out.println("loaded "+workspaces.size()+" workspaces"); + List result = new ArrayList<>(); + for(File workspace : workspaces){ + result.addAll(files(workspace)); + System.out.println("Loaded["+result.size()+"] "+workspace.getAbsolutePath()); + } + return result; + } + private List files(File dir){ List result = new ArrayList<>(); if(dir.isDirectory()){