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 2021/05/18 16:11:10 UTC

[GitHub] [netbeans] lkishalmi commented on a change in pull request #2924: [NETBEANS-5627] [NETBEANS-5629] Gradle early Lookup and Classpath initialization.

lkishalmi commented on a change in pull request #2924:
URL: https://github.com/apache/netbeans/pull/2924#discussion_r634535430



##########
File path: extide/gradle/src/org/netbeans/modules/gradle/api/NbGradleProject.java
##########
@@ -206,6 +210,30 @@ public Quality getAimedQuality() {
     public boolean isUnloadable() {
         return getQuality().worseThan(Quality.SIMPLE);
     }
+    
+    /**
+     * Attempts to refresh the project to at least the desired quality. The project information
+     * may be reloaded, if the project is currently loaded with lower {@link Quality} than {@code q}.
+     * If {@code forceLoad} is true, the project reloads even if the {@code q} is worse quality than
+     * the current {@link #getQuality()} level. Reason for the reload may be specified: if the reload
+     * takes some time (i.e. executing Gradle build), the IDE may use the {@code reason} text to annotate
+     * the ongoing progress.
+     * <p/>
+     * The returned {@link CompletionStage} may complete in this thread, or asynchronously in an unspecified thread.
+     * <p/>
+     * Note that the loading may fail, so the returned Quality may be <b>less than requested</b>. For example
+     * if the project is not trusted, its Gradle build will not be executed, so the returned quality can be {@link Quality#EVALUATED}.
+     * 
+     * @param reason reason for reload, may be {@code null}.
+     * @param q the desired quality of project information
+     * @param forceLoad force load even though the current info quality is sufficient.
+     * @return {@link CompletionStage} with the reloaded project. Use {@link CompletionStage#toCompletableFuture()}.{@link CompletableFuture#get get()} 
+     * to block waiting for the result.
+     * @since 2.11
+     */
+    public @NonNull CompletionStage<NbGradleProject> toQuality(@NullAllowed String reason, @NonNull Quality q, boolean forceLoad) {

Review comment:
       Interesting way to move forward! Really waiting for this PR to go in mainline after the 12.4 API snapshot happens.




-- 
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