Skip to content

Commit

Permalink
Allow loading plugin metadata with invalid plugin ID
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-gh committed Dec 4, 2016
1 parent 607a1a9 commit d555959
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/org/spongepowered/plugin/meta/PluginMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public final class PluginMetadata implements Consumer<PluginMetadata> {
/**
* Constructs a new {@link PluginMetadata} with the specified plugin ID.
*
* @param id The plugin ID, must match {@link #ID_PATTERN}
* @param id The plugin ID
* @throws IllegalArgumentException If the plugin ID is empty
*/
public PluginMetadata(String id) {
setId(id);
Expand All @@ -94,13 +95,12 @@ public String getId() {
/**
* Sets the plugin ID that is represented by this {@link PluginMetadata}.
*
* @param id The plugin ID, must match {@link #ID_PATTERN}
* @throws IllegalArgumentException If the plugin ID does not match
* {@link #ID_PATTERN}
* @param id The plugin ID
* @throws IllegalArgumentException If the plugin ID is empty
*/
public void setId(String id) {
checkNotNull(id, "id");
checkArgument(ID_PATTERN.matcher(id).matches(), "id must match pattern %s", ID_PATTERN);
checkArgument(!id.isEmpty(), "id cannot be empty");
this.id = id;
}

Expand Down

0 comments on commit d555959

Please sign in to comment.