Akshay-Gupta-Oracle commented on a change in pull request #2305:
URL: https://github.com/apache/netbeans/pull/2305#discussion_r502961349
##########
File path:
java/java.source.base/src/org/netbeans/modules/java/source/parsing/JavacParser.java
##########
@@ -424,9 +434,28 @@ private void parseImpl(
break;
default:
init (snapshot, task, false);
+ DiagnosticListener<JavaFileObject> diagnosticListener;
+ JavacTaskImpl javacTask;
+ boolean
oneInstanceJava=Boolean.getBoolean("java.enable.single.javac") &&
this.snapshotSize <= this.MAX_FILE_SIZE;
+ if (sequentialParsing == null && ciImpl == null &&
oneInstanceJava) {
+ List<JavaFileObject> jfos = new ArrayList<>();
+ for (Snapshot s : snapshots) {
+
jfos.add(FileObjects.sourceFileObject(s.getSource().getFileObject(), root,
JavaFileFilterQuery.getFilter(s.getSource().getFileObject()), s.getText()));
+ }
+ diagnosticListener = new
CompilationInfoImpl.DiagnosticListenerImpl(this.root, jfos.get(0), this.cpInfo);
+ javacTask = JavacParser.createJavacTask(this.file,
jfos, this.root, this.cpInfo,
+ this, diagnosticListener, false);
+ } else if (ciImpl != null && oneInstanceJava) {
+ diagnosticListener = ciImpl.getDiagnosticListener();
+ javacTask = ciImpl.getJavacTask();
+ oldParsedTrees=ciImpl.getParsedTrees();
+ } else {
+ diagnosticListener = null;
+ javacTask = null;
+ }
ciImpl = createCurrentInfo(this, file, root, snapshot,
- sequentialParsing == null || ciImpl == null ? null :
ciImpl.getJavacTask(),
- sequentialParsing == null || ciImpl == null ? null :
ciImpl.getDiagnosticListener());
+ javacTask,
Review comment:
You're correct @jlahoda I've removed the oninstance variable form second
if. and added (sequentialParsing != null || oneInstanceJava) instead.
Now this PR is final
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists