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/10/28 18:37:27 UTC

[GitHub] [netbeans] jglick commented on a change in pull request #504: Option to skip CoS copying of class files when the target is already newer, such as from an external compilation

jglick commented on a change in pull request #504:
URL: https://github.com/apache/netbeans/pull/504#discussion_r513676737



##########
File path: java/java.source.base/src/org/netbeans/modules/java/source/usages/BuildArtifactMapperImpl.java
##########
@@ -853,8 +870,9 @@ private Boolean performUpdate(@NonNull final Context ctx) throws IOException {
                 File target = resolveFile(targetFolder, relPath);                        
 
                 try {
-                    copyFile(updatedFile, target);
-                    updatedFiles.add(target);
+                    if (copyFile(updatedFile, target, new URL(ctx.getSourceRoot(), relPath))) {
+                        updatedFiles.add(target);

Review comment:
       I do not think so. The idea here is that a build created/updated, say, `target/classes/pkg/Clazz.class` so it now has a newer timestamp than `Clazz.sig` and we should not clobber it with an older and possibly not-quite-correct version. There is nothing to listen to. If the next thing that happens is another external build, the timestamp will be even newer, and so the next CoS run will again trust the `Clazz.class`. If on the other hand the user edits & saves `Clazz.java`, causing `Clazz.sig` to be updated, and next does a CoS run, then we will overwrite `Clazz.class` with the contents of `Clazz.sig`.




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