Closed stbischof closed 7 months ago
Well, the preprocessorSymbols
cannot actually be null in that spot. The map is instantiated here, passed into the mainProgram
method here and passed into the Grammar constructor here. And that is the only path of execution to get there, since that is the only place where that constructor is invoked.
So it can't be null and it can't be immutable either. But, to tell the truth, I don't really understand why this is much of an issue. If, by some chance, the map was null or immutable (though it can't be, as you can see from eyeballing the code) the JVM would throw an NPE and we'd have a stack trace and it would be fixed in about a minute. Or, in other words, a bug of that nature cannot really survive, has such a low life expectancy that...
I had this null in the maven Plugin. In your Code it is fine.
But lwhen others use the classe direkt they may bit know what happens.
Thx,
if others put a ImmutableMap in, it will also fail if you call put
.
Perhaps we just make a copy of the value passed in, which will just be an ordinary HashMap
(and thus mutable).
https://github.com/congo-cc/congo-parser-generator/blob/a0afa3197f7af83267073fa8792806aba967b841/src/java/org/congocc/core/Grammar.java#L59