Fix NullPointerException in CPPTokenizer:99
Due to `skipBlocks = true` and `skipBlocksStart` being uninitialized in `CPPTokenizer`, `maybeSkipBlocks` would always throw a NullPointerException as it is assuming that `setProperties` is always called after the constructor. Changed `CPPLanguage` to always invoke `setProperties`, similarly to `CsLanguage`. This only happens in programmatic invocations.
This commit is contained in:
@ -16,7 +16,12 @@ public class CPPLanguage extends AbstractLanguage {
|
||||
* for c/c++ files.
|
||||
*/
|
||||
public CPPLanguage() {
|
||||
this(System.getProperties());
|
||||
}
|
||||
|
||||
public CPPLanguage(Properties properties) {
|
||||
super("C++", "cpp", new CPPTokenizer(), ".h", ".hpp", ".hxx", ".c", ".cpp", ".cxx", ".cc", ".C");
|
||||
setProperties(properties);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user