cstamas commented on code in PR #1299: URL: https://github.com/apache/maven/pull/1299#discussion_r1387786371
########## maven-core/src/main/java/org/apache/maven/artifact/handler/manager/LegacyArtifactHandlerManager.java: ########## @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.maven.artifact.handler.manager; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Singleton; + +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +import org.apache.maven.artifact.handler.ArtifactHandler; +import org.apache.maven.artifact.handler.DefaultArtifactHandler; + +/** + */ +@Named +@Singleton +public class LegacyArtifactHandlerManager implements ArtifactHandlerManager { Review Comment: This is a simple trick: * legacyAHM is what "default" was so far (it have legacy AHs injected), is new, but nobody uses it as it is new thing (just new code "knows" about it) * defaultAHM changed to delegate calls to typeRegistry * typeRegistry uses as a fallback legacyAHM This completes the circle: * legacy code will refer to defaultAHM that goes to typeRegistry that will refer legacyAHM (as fallback) * new code will refer to typeRegistry that will refer legacyAHM (as fallback) This way new code and legacy code both "see" the same things: whether it is new AH (legacy) or Type (new) being added by extension for example -- 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]
