@@ -53,6 +53,8 @@ public class NewModuleDialog extends AbstractDialog implements ListSelectionList
53
53
private static final String MODULE_VERSION = "module version" ;
54
54
private static final String MODULE_NAME = "module name" ;
55
55
private static final String PACKAGE_NAME = "package name" ;
56
+ private static final String MAGENTO_BEFORE_DECLARATIVE_SCHEMA_VERSION = "2.2.11" ;
57
+ private static final String DEFAULT_MODULE_PREFIX = "module" ;
56
58
57
59
@ FieldValidation (rule = RuleRegistry .NOT_EMPTY ,
58
60
message = {NotEmptyRule .MESSAGE , PACKAGE_NAME })
@@ -106,8 +108,6 @@ public class NewModuleDialog extends AbstractDialog implements ListSelectionList
106
108
private String detectedPackageName ;
107
109
private final ModuleIndex moduleIndex ;
108
110
private final CamelCaseToHyphen camelCaseToHyphen ;
109
- private static final String MAGENTO_BEFORE_DECLARATIVE_SCHEMA_VERSION = "2.2.11" ;
110
- private static final String DEFAULT_MODULE_PREFIX = "module" ;
111
111
112
112
/**
113
113
* Constructor.
@@ -252,22 +252,7 @@ public String getPackageName() {
252
252
* @return String
253
253
*/
254
254
public String getModuleName () {
255
- return this .removeSubstringFormString (
256
- DEFAULT_MODULE_PREFIX , this .moduleName .getText ().trim ()
257
- );
258
- }
259
-
260
- /**
261
- * Remove substring from string.
262
- * @param target String
263
- * @param replacement String
264
- * @return String
265
- */
266
- private String removeSubstringFormString (
267
- final @ NotNull String target , final @ NotNull String replacement
268
- ) {
269
- final String moduleRegex = "(?i)" + target ;
270
- return replacement .replaceAll (moduleRegex , "" );
255
+ return this .moduleName .getText ().trim ();
271
256
}
272
257
273
258
/**
0 commit comments