gnodet-bot commented on code in PR #11405:
URL: https://github.com/apache/maven/pull/11405#discussion_r4256950270


##########
api/maven-api-core/src/main/java/org/apache/maven/api/services/TempFileService.java:
##########
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.api.services;
+
+import java.io.IOException;
+import java.nio.file.Path;
+
+import org.apache.maven.api.Service;
+import org.apache.maven.api.Session;
+import org.apache.maven.api.annotations.Experimental;
+import org.apache.maven.api.annotations.Nonnull;
+import org.apache.maven.api.annotations.Nullable;
+
+/**
+ * Service to create and track temporary files/directories for a Maven build.
+ * All created paths are deleted automatically when the session ends.
+ *
+ * @since 4.1.0
+ */
+@Experimental
+public interface TempFileService extends Service {
+
+    /**
+     * Creates a temp file in the default temp directory.
+     *
+     * @throws IOException if the path cannot be created
+     */
+    @Nonnull
+    Path createTempFile(@Nonnull Session session, @Nullable String prefix, 
@Nullable String suffix) throws IOException;

Review Comment:
   📝 **Missing `@param` and `@return` tags on all factory methods**
   
   All six methods in this interface have Javadoc but are missing `@param` and 
`@return` documentation. Every other Maven 4 API service interface 
(`ArtifactResolver`, `DependencyResolver`, `VersionResolver`, etc.) 
consistently documents all parameters and return values with Javadoc tags.
   
   For example, `createTempFile(Session, String, String)` should read:
   
   ```suggestion
       /**
        * Creates a temp file in the default temp directory.
        *
        * @param session the Maven session, must not be {@code null}
        * @param prefix the prefix string to be used in generating the file's 
name; may be {@code null}
        * @param suffix the suffix string to be used in generating the file's 
name; may be {@code null}
        * @return the path to the newly created temp file, never {@code null}
        * @throws IOException if the path cannot be created
        */
   ```
   
   Please add `@param` and `@return` tags to all six methods (`createTempFile` 
×2, `createTempDirectory` ×2, `register`, `cleanup`).



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to