String (@Nullable Project project, @NotNull String actionId) { // expected format antIdPrefix{_modelName}_targetName String idPrefix = project != null? AntConfiguration.getActionIdPrefix(project) : AntConfiguration.ACTION_ID_PREFIX; if (actionId.length() <= idPrefix.length() || !actionId.startsWith(idPrefix)) { return null; } if (actionId.charAt(idPrefix.length()) != '_') { return null; } int nextSeparatorIndex = actionId.indexOf('_', idPrefix.length() + 1); return nextSeparatorIndex > idPrefix.length()? actionId.substring(idPrefix.length() + 1, nextSeparatorIndex) : null; }