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:
Rafael Cortês
2018-07-29 09:11:15 +01:00
committed by GitHub
parent c598d3b049
commit 888824d24a

View File

@ -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);
}
/*