Java Java Objects Creating the MVP Counting Scrabble Tiles

Hayley Smith
Hayley Smith
1,595 Points

Strange Error on scrabble project

I'm not sure what I've done wrong

com.github.javaparser.ParseException: Encountered "" at line 30, column 4. Was expecting one of: "abstract" ... "boolean" ... "byte" ... "char" ... "class" ... "default" ... "double" ... "enum" ... "final" ... "float" ... "int" ... "interface" ... "long" ... "native" ... "private" ... "protected" ... "public" ... "short" ... "static" ... "strictfp" ... "synchronized" ... "transient" ... "void" ... "volatile" ... ... "{" ... "}" ... ";" ... "@" ... "<" ...

at com.github.javaparser.ASTParser.generateParseException(ASTParser.java:9056)
at com.github.javaparser.ASTParser.jj_consume_token(ASTParser.java:8929)
at com.github.javaparser.ASTParser.ClassOrInterfaceBody(ASTParser.java:857)
at com.github.javaparser.ASTParser.ClassOrInterfaceDeclaration(ASTParser.java:444)
at com.github.javaparser.ASTParser.TypeDeclaration(ASTParser.java:372)
at com.github.javaparser.ASTParser.CompilationUnit(ASTParser.java:185)
at com.github.javaparser.JavaParser.parse(JavaParser.java:111)
at com.github.javaparser.JavaParser.parse(JavaParser.java:133)
at com.teamtreehouse.ast.Inspector.(Inspector.java:41)
at com.teamtreehouse.ast.Inspector.fromSource(Inspector.java:70)
at JavaTester.run(JavaTester.java:68)
at JavaTester.main(JavaTester.java:44)

java.lang.IllegalArgumentException: ParseException: com.github.javaparser.ParseException: Encountered "" at line 30, column 4. Was expecting one of: "abstract" ... "boolean" ... "byte" ... "char" ... "class" ... "default" ... "double" ... "enum" ... "final" ... "float" ... "int" ... "interface" ... "long" ... "native" ... "private" ... "protected" ... "public" ... "short" ... "static" ... "strictfp" ... "synchronized" ... "transient" ... "void" ... "volatile" ... ... "{" ... "}" ... ";" ... "@" ... "<" ...

at com.teamtreehouse.ast.Inspector.fromSource(Inspector.java:73)
at JavaTester.run(JavaTester.java:68)
at JavaTester.main(JavaTester.java:44)

1 Answer

david101
david101
2,088 Points

Can you post your code too as it's hard to figure out without seeing what you are trying to compile and run.

Usually this error does appear if there is a miss match with your open and closing brackets i.e. { } Check that you don't have too many or not enough or that some haven't been closed.