@@ -75,9 +75,10 @@ public OutputStream newOutputStream(Path file) throws IOException {
7575 public OutputStream newOutputStream (Path file , boolean derived ) throws IOException {
7676 OutputStream outputStream = newOutputStream (file );
7777 if (derived ) {
78- // Mark the file as derived after creating the output stream
79- // The marking happens here so that implementations can wrap the stream
80- // if needed to defer the marking until after successful write
78+ // Mark the file as derived after creating the output stream.
79+ // In the default implementation, markDerived is a no-op, so the timing doesn't matter.
80+ // Custom implementations that track derived files should consider wrapping the stream
81+ // to defer marking until successful close() to avoid marking files on failed writes.
8182 markDerived (file );
8283 }
8384 return outputStream ;
@@ -96,10 +97,10 @@ public Path getPath(String relpath) {
9697 if (relpath == null ) {
9798 throw new IllegalArgumentException ("relpath cannot be null" );
9899 }
99- // Get the basedir from the build context by checking a known file
100- // The BuildContext API doesn't expose basedir directly, so we need to work around this
101- // For the default implementation, we'll resolve against the current working directory
102- // Custom implementations should override this to use the actual basedir
100+ // Note: The BuildContext API doesn't expose basedir directly.
101+ // This default implementation resolves paths relative to the current working directory.
102+ // Custom implementations (e.g., IDE integrations) should override this method
103+ // to resolve against the actual build context basedir.
103104 return java .nio .file .Paths .get (relpath );
104105 }
105106
0 commit comments