Commit | Line | Data |
---|---|---|
48c86220 GB |
1 | Based on the upstream fix for the java8 compilation issue. |
2 | Simplified patch. | |
3 | Upstream version of patch does not work with this source tree. | |
4 | ||
5 | The issue is that in java8 it is an error to pass null to | |
6 | removeAll. Results in null pointer exception. java7 | |
7 | behaviour was to return the list unmodified. | |
8 | ||
9 | From 43867d50c05d1c06ab7220eb974a8874ae10c308 Mon Sep 17 00:00:00 2001 | |
10 | From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <boskovits@gmail.com> | |
11 | Date: Fri, 5 Jan 2018 19:08:24 +0100 | |
12 | Subject: [PATCH] Fix java8 complilation error. | |
13 | ||
14 | --- | |
15 | tool/src/main/java/org/antlr/tool/CompositeGrammar.java | 4 +++- | |
16 | 1 file changed, 3 insertions(+), 1 deletion(-) | |
17 | ||
18 | diff --git a/tool/src/main/java/org/antlr/tool/CompositeGrammar.java b/tool/src/main/java/org/antlr/tool/CompositeGrammar.java | |
19 | index f34ea73..63740a6 100644 | |
20 | --- a/tool/src/main/java/org/antlr/tool/CompositeGrammar.java | |
21 | +++ b/tool/src/main/java/org/antlr/tool/CompositeGrammar.java | |
22 | @@ -226,7 +226,9 @@ public class CompositeGrammar { | |
23 | public List<Grammar> getIndirectDelegates(Grammar g) { | |
24 | List<Grammar> direct = getDirectDelegates(g); | |
25 | List<Grammar> delegates = getDelegates(g); | |
26 | - delegates.removeAll(direct); | |
27 | + if(direct != null) { | |
28 | + delegates.removeAll(direct); | |
29 | + } | |
30 | return delegates; | |
31 | } | |
32 | ||
33 | -- | |
34 | 2.15.1 | |
35 |