You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/09/22 10:48:52 UTC
[GitHub] [netbeans] lahodaj commented on a change in pull request #2305: [NETBEANS-3693] Create only one instance of javac
lahodaj commented on a change in pull request #2305:
URL: https://github.com/apache/netbeans/pull/2305#discussion_r492639776
##########
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:
I suspect this will disable "sequential" processing when nb-javac is installed, right? Or do I miss something here?
----------------------------------------------------------------
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists