Skip to content

Consolidate ArtifactDescriptorReaderDelegate into DefaultArtifactDescriptorReader#10938

Merged
gnodet merged 1 commit intoapache:masterfrom
gnodet:consolidate-artifact-descriptor-reader-delegate
Aug 5, 2025
Merged

Consolidate ArtifactDescriptorReaderDelegate into DefaultArtifactDescriptorReader#10938
gnodet merged 1 commit intoapache:masterfrom
gnodet:consolidate-artifact-descriptor-reader-delegate

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented Jul 18, 2025

Summary

This PR consolidates the ArtifactDescriptorReaderDelegate functionality directly into DefaultArtifactDescriptorReader in the main implementation (impl/maven-impl), while preserving the original delegate pattern in the deprecated compat module for backward compatibility.

Background

The ArtifactDescriptorReaderDelegate class was marked as "work in progress" and could be "changed or removed without notice" since version 3.2.4. The current implementation uses a delegate pattern with an unused extension mechanism through session config properties that appears to have no practical usage.

Changes Made

Main Implementation (impl/maven-impl)

  • Consolidated functionality: Moved all methods from ArtifactDescriptorReaderDelegate as private methods in DefaultArtifactDescriptorReader
  • Removed delegate pattern: Eliminated the delegate field and its initialization
  • Simplified extension mechanism: Removed the unused session config properties lookup for custom delegates
  • Maintained functionality: All existing behavior is preserved for normal usage
  • Deleted: ArtifactDescriptorReaderDelegate.java

Compat Module (unchanged)

  • Preserved original pattern: The deprecated compat module retains the original delegate pattern
  • Backward compatibility: Existing code using the compat module continues to work
  • Deprecation path: Since the compat module is already deprecated for removal in 4.0.0, this provides a clean migration path

Benefits

  1. Cleaner codebase: Removes unnecessary abstraction that was marked as work-in-progress
  2. Better encapsulation: Conversion methods are now private implementation details
  3. Simplified maintenance: Fewer classes to maintain in the main implementation
  4. Preserved compatibility: No breaking changes for normal usage
  5. Clear migration path: Users can migrate from compat to main implementation when ready

Backward Compatibility

This change maintains backward compatibility for normal usage:

  • The public API of DefaultArtifactDescriptorReader remains unchanged
  • All functionality is identical, just moved from a separate class to private methods
  • The only potential breaking change is for code using the undocumented extension mechanism through session config properties, which appears to be unused

Future Extension Points

If a proper extension point is needed in the future, it can be designed more explicitly with:

  • Proper interfaces and contracts
  • Clear documentation
  • Well-defined extension mechanisms
  • Proper testing and validation

This consolidation removes the work-in-progress delegate pattern and provides a cleaner foundation for any future extension needs.


Pull Request opened by Augment Code with guidance from the PR author

@gnodet gnodet force-pushed the consolidate-artifact-descriptor-reader-delegate branch from a69e6d3 to d045b7c Compare July 18, 2025 10:04
@gnodet gnodet force-pushed the consolidate-artifact-descriptor-reader-delegate branch 2 times, most recently from c41f7b3 to 4e12e25 Compare July 18, 2025 14:10
…riptorReader

The ArtifactDescriptorReaderDelegate was marked as 'work in progress' and
could be 'changed or removed without notice'. This change consolidates its
functionality directly into DefaultArtifactDescriptorReader by:

- Moving all delegate methods as private methods in DefaultArtifactDescriptorReader
- Removing the unused extension mechanism via session config properties
- Simplifying the codebase by removing unnecessary abstraction
- Maintaining identical functionality for normal usage

The compat module retains the original delegate pattern for backward compatibility
since it's already deprecated and marked for removal in 4.0.0.

If a proper extension point is needed in the future, it can be designed more
explicitly with proper interfaces and documentation.

Also fixes maven.config to be compatible with Maven 3.6.x by removing comment
that causes parsing errors in older Maven versions.
@gnodet gnodet force-pushed the consolidate-artifact-descriptor-reader-delegate branch from 4e12e25 to 87c86ae Compare July 18, 2025 14:12
@gnodet
Copy link
Copy Markdown
Contributor Author

gnodet commented Jul 24, 2025

@elharo another look ?

@gnodet gnodet merged commit 90ef708 into apache:master Aug 5, 2025
19 checks passed
@github-actions github-actions Bot added this to the 4.1.0 milestone Aug 5, 2025
@gnodet gnodet deleted the consolidate-artifact-descriptor-reader-delegate branch September 2, 2025 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants