-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11098 from gastaldi/add_extension_fix
Avoid installing multiple extensions with multiple matches
- Loading branch information
Showing
4 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...s/devtools-common/src/main/java/io/quarkus/registry/MultipleExtensionsFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.quarkus.registry; | ||
|
||
import io.quarkus.dependencies.Extension; | ||
import java.util.Collection; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Thrown when multiple extensions are found for a given extension when | ||
* {@link ExtensionRegistry#planInstallation(String, Collection)} is called | ||
* | ||
* @see {@link ExtensionRegistry#planInstallation(String, Collection)} | ||
*/ | ||
public class MultipleExtensionsFoundException extends RuntimeException { | ||
|
||
private final String keyword; | ||
private final Collection<Extension> extensions; | ||
|
||
public MultipleExtensionsFoundException(String keyword, Collection<Extension> extensions) { | ||
this.keyword = Objects.requireNonNull(keyword, "Keyword must not be null"); | ||
this.extensions = Objects.requireNonNull(extensions, "Extensions should not be null"); | ||
} | ||
|
||
public String getKeyword() { | ||
return keyword; | ||
} | ||
|
||
public Collection<Extension> getExtensions() { | ||
return extensions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters