Skip to content

Commit 8c149d9

Browse files
committed
Trim down PR apache#2506: Remove configuration and statistics
This commit removes the following components from the comprehensive PR apache#2506: - CacheConfigurationResolver and related configuration classes - CacheStatistics and related statistics tracking - Cache configuration parsing and system property handling - Factory methods from InputSource and InputLocation (merge methods) - Complex object pooling configuration (keeping only Dependency pooling) Remaining work: - Fix compilation errors for missing interfaces - Adapt to current master branch API structure - Ensure all tests pass This trimmed version keeps the core cache improvements while removing the configuration complexity that's not needed for the 4.0.x branch.
1 parent acc18b3 commit 8c149d9

File tree

14 files changed

+65
-2718
lines changed

14 files changed

+65
-2718
lines changed

api/maven-api-model/src/main/java/org/apache/maven/api/model/InputLocation.java

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -182,75 +182,9 @@ public InputLocation getImportedFrom() {
182182
return importedFrom;
183183
}
184184

185-
/**
186-
* Merges the {@code source} location into the {@code target} location.
187-
*
188-
* @param target the target location
189-
* @param source the source location
190-
* @param sourceDominant the boolean indicating of {@code source} is dominant compared to {@code target}
191-
* @return the merged location
192-
*/
193-
public static InputLocation merge(InputLocation target, InputLocation source, boolean sourceDominant) {
194-
if (source == null) {
195-
return target;
196-
} else if (target == null) {
197-
return source;
198-
}
199-
200-
Map<Object, InputLocation> locations;
201-
Map<Object, InputLocation> sourceLocations = source.locations;
202-
Map<Object, InputLocation> targetLocations = target.locations;
203-
if (sourceLocations == null) {
204-
locations = targetLocations;
205-
} else if (targetLocations == null) {
206-
locations = sourceLocations;
207-
} else {
208-
locations = new LinkedHashMap<>();
209-
locations.putAll(sourceDominant ? targetLocations : sourceLocations);
210-
locations.putAll(sourceDominant ? sourceLocations : targetLocations);
211-
}
212-
213-
return new InputLocation(-1, -1, InputSource.merge(source.getSource(), target.getSource()), locations);
214-
} // -- InputLocation merge( InputLocation, InputLocation, boolean )
215185

216-
/**
217-
* Merges the {@code source} location into the {@code target} location.
218-
* This method is used when the locations refer to lists and also merges the indices.
219-
*
220-
* @param target the target location
221-
* @param source the source location
222-
* @param indices the list of integers for the indices
223-
* @return the merged location
224-
*/
225-
public static InputLocation merge(InputLocation target, InputLocation source, Collection<Integer> indices) {
226-
if (source == null) {
227-
return target;
228-
} else if (target == null) {
229-
return source;
230-
}
231186

232-
Map<Object, InputLocation> locations;
233-
Map<Object, InputLocation> sourceLocations = source.locations;
234-
Map<Object, InputLocation> targetLocations = target.locations;
235-
if (sourceLocations == null) {
236-
locations = targetLocations;
237-
} else if (targetLocations == null) {
238-
locations = sourceLocations;
239-
} else {
240-
locations = new LinkedHashMap<>();
241-
for (int index : indices) {
242-
InputLocation location;
243-
if (index < 0) {
244-
location = sourceLocations.get(~index);
245-
} else {
246-
location = targetLocations.get(index);
247-
}
248-
locations.put(locations.size(), location);
249-
}
250-
}
251187

252-
return new InputLocation(-1, -1, InputSource.merge(source.getSource(), target.getSource()), locations);
253-
} // -- InputLocation merge( InputLocation, InputLocation, java.util.Collection )
254188

255189
@Override
256190
public boolean equals(Object o) {

api/maven-api-model/src/main/java/org/apache/maven/api/model/InputSource.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,5 @@ public String toString() {
165165
return getModelId() + " " + getLocation();
166166
}
167167

168-
public static InputSource merge(InputSource src1, InputSource src2) {
169-
return new InputSource(
170-
Stream.concat(src1.sources(), src2.sources()).distinct().toList());
171-
}
168+
172169
}

impl/maven-impl/src/main/java/org/apache/maven/impl/cache/CacheConfig.java

Lines changed: 0 additions & 93 deletions
This file was deleted.

impl/maven-impl/src/main/java/org/apache/maven/impl/cache/CacheConfigurationResolver.java

Lines changed: 0 additions & 187 deletions
This file was deleted.

0 commit comments

Comments
 (0)