public List getReleases()

in src/main/java/org/apache/maven/plugins/changes/IssueAdapter.java [67:99]


    public List<Release> getReleases( List<Issue> issues )
    {
        // A Map of releases keyed by fixVersion
        Map<String, Release> releasesMap = new HashMap<>();

        // Loop through all issues looking for fixVersions
        for ( Issue issue : issues )
        {
            // Do NOT create a release for issues that lack a fixVersion
            if ( issue.getFixVersions() != null )
            {
                for ( String fixVersion : issue.getFixVersions() )
                {
                    // Try to get a matching Release from the map
                    Release release = releasesMap.get( fixVersion );
                    if ( release == null )
                    {
                        // Add a new Release to the Map if it wasn't there
                        release = new Release();
                        release.setVersion( fixVersion );
                        releasesMap.put( fixVersion, release );
                    }

                    // Add this issue as an Action to this release
                    Action action = createAction( issue );
                    release.addAction( action );
                }
            }
        }

        // Extract the releases from the Map to a List
        return new ArrayList<>( releasesMap.values() );
    }