merge with https://hg.netbeans.org/main/contrib
authorLou Dasaro <mr_lou_d@netbeans.org>
Wed, 12 Aug 2015 23:27:34 -0500
changeset 18297dcf70135c86f
parent 18296 ab5c0f763eb0
parent 18295 0bf82b105206
child 18298 047218e7b04f
merge with https://hg.netbeans.org/main/contrib
     1.1 --- a/python.editor/src/org/netbeans/modules/python/editor/PythonParser.java	Wed Aug 12 23:20:16 2015 -0500
     1.2 +++ b/python.editor/src/org/netbeans/modules/python/editor/PythonParser.java	Wed Aug 12 23:27:34 2015 -0500
     1.3 @@ -299,19 +299,24 @@
     1.4  
     1.5                          errors.add(new DefaultError(null, message, null, file, start, end, Severity.ERROR));
     1.6  
     1.7 +                        // In order to avoid a StackOverflowError, the BaseRecognizer must be recreated.
     1.8 +                        // We must keep the names of the tokens to avoid a NullPointerException.
     1.9 +                        // See bz252630
    1.10 +                        final String[] tokenNames = br.getTokenNames();
    1.11                          br = new BaseRecognizer() {
    1.12  
    1.13                              @Override
    1.14                              public String getSourceName() {
    1.15                                  return file.getName();
    1.16                              }
    1.17 +
    1.18 +                            @Override
    1.19 +                            public String[] getTokenNames() {
    1.20 +                                return tokenNames;
    1.21 +                            }
    1.22                          };
    1.23 -                        try {
    1.24 -                            super.reportError(br, re);
    1.25 -                        } catch (NullPointerException e) {
    1.26 -                            
    1.27 -                        }
    1.28 -                        
    1.29 +
    1.30 +                        super.reportError(br, re);
    1.31                      }
    1.32                  }
    1.33              };