Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. The pace at which javac/JDK moves and at which NetBeans moves is simply different. E.g., imagine a refactoring breaking a user's code because of error recovery misbehaving. Once the problem is found it may be fixed in nb-javac in hours or days. Fixing it in javac can easily take weeks or even months (and much more effort in testing and review). 

  2. Even some changes that from the NetBeans point may look innocent may be hard to get into vanilla javac. For example, when javac detects a syntax error, it normally ends without getting to a semantic analysis. This does not work for an IDE (noone probably wants to lose almost all features just because a semicolon is missing). But it may be difficult to push through a fix to semantic analysis for a syntactically broken code (sometimes this passed before, other times, there was a pushback on such changes, depending on the nature of the change needed). 

  3. Some of the changes in nb-javac may be very hard to get in unless there is it has another user than just NetBeans.

Taking a step back, what are the potential alternative Java parsing libraries to support NetBeans as a Java IDE?

1. Write a new library/compiler. Not quite realistic.

2. Use some other than javac (like from Eclipse). Not sure what would be the differentiator between Eclipse and NetBeans? Would result in incompatible changes and probably almost a complete re-write of the existing Java support in NetBeans (unless the Java support itself would be taken from Eclipse as well, which aside from everything else would be a lot of rework too).

3. Use a vanilla (unpatched) javac from the current runtime JDK. Besides other complexities, one would need to run on JDK 9 to get the possibility of JDK 9 support (and on, e.g., Valhalla to get the possibility of having Valhalla support), which might possibly lead to workarounds for differences/bugs between JDK versions. Plus, we might run into trouble with strong encapsulation.

4. Use a vanilla (unpatched) javac corresponding to a particular revision from the OpenJDK, but let NetBeans have a firm (binary) copy against which it would run, regardless of which runtime JDK would be used. Still a significant endeavour.

5. Keep nb-javac as it is now. Certainly the least amount of work and complexity.