This is not an recursion. Inside 

    resolveSideArtifact(final org.apache.maven.artifact.Artifact mainArtifact, final String classifier,
        final String type)

we call 

    resolveSideArtifact(final org.sonatype.aether.artifact.Artifact mainArtifact, final String classifier,
        final String type)

since the artifact created in the first method body is a org.sonatype.aether.artifact.Artifact and not a org.apache.maven.artifact.Artifact.

Mind the difference in the package for Artifact