SonarOpenCommunity / sonar-cxx

Unsynchronized lazy initialization of static value detected JAVA-E1053
Bug risk
Critical
5 months agoa year old
Initialization of lexer may be subject to race conditions
55  static List<Token> transformToCxx(List<Token> ppTokens, Token newPos) {
56    List<Token> result = new ArrayList<>(ppTokens.size());
57
58    if (lexer == null) { // lazy initialization59      lexer = CxxLexerPool.create().getLexer();
60    }
61