desruisseaux commented on code in PR #1002:
URL:
https://github.com/apache/maven-compiler-plugin/pull/1002#discussion_r2597683644
##########
src/main/java/org/apache/maven/plugin/compiler/ToolExecutor.java:
##########
@@ -453,30 +500,36 @@ private void setDependencyPaths(final
StandardJavaFileManager fileManager) throw
* @param first the path to put first
* @return the new paths for the given type, as a modifiable list
*/
- protected List<Path> prependDependency(final PathType pathType, final Path
first) {
- List<Path> paths = dependencies(pathType);
- paths.add(0, first);
+ protected Deque<Path> prependDependency(final PathType pathType, final
Path first) {
+ Deque<Path> paths = dependencies(pathType);
+ paths.addFirst(first);
return paths;
}
/**
- * Ensures that the given value is non-null, replacing null values by the
latest version.
+ * Removes the first <var>n</var> elements of the given collection.
+ * This is used for removing {@code --patch-module} items that were added
as source directories.
+ * The callers should replace the removed items by the output directory of
these source files.
+ *
+ * @param paths the paths from which to remove the first elements
+ * @param count number of elements to remove, or {@code null} if none
+ * @return whether at least one item has been removed
*/
- private static SourceVersion nonNullOrLatest(SourceVersion release) {
- return (release != null) ? release : SourceVersion.latest();
+ private static boolean removeFirsts(Deque<Path> paths, Integer count) {
+ boolean changed = false;
+ if (count != null) {
+ for (int i = count; --i >= 9; ) {
Review Comment:
Fixed.
--
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]