Revert "Ignore unknown plugin options in REST endpoints that support dynamic options"
This reverts commit 6210be243d.
We are currently discussing alternative solutions [1] and want to start
from scratch once we decided which one we like most.
[1] https://gerrit-review.googlesource.com/c/gerrit/+/231004/2//COMMIT_MSG
Change-Id: I906eac5eef2e7163a608227d4822984474bdf413
This commit is contained in:
@@ -25,22 +25,6 @@ import com.google.gerrit.common.Nullable;
|
||||
* behavior if classes do not implement this interface).
|
||||
*/
|
||||
public interface UnknownOptionHandler {
|
||||
/**
|
||||
* Checks whether the given option name matches the naming pattern of options that are defined by
|
||||
* plugins that were defined by registering a {@link
|
||||
* com.google.gerrit.server.DynamicOptions.DynamicBean}.
|
||||
*
|
||||
* @param optionName name of the option
|
||||
* @return {@code true} if it's a plugin option, otherwise {@code false}
|
||||
*/
|
||||
public static boolean isPluginOption(String optionName) {
|
||||
// Options from plugins have the following name pattern: '--<plugin-name>--<option-name>'
|
||||
if (optionName.startsWith("--")) {
|
||||
optionName = optionName.substring(2);
|
||||
}
|
||||
return optionName.contains("--");
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether an unknown option should be accepted.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user