File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed
magento2plugin/magento/packages Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 9
9
import java .util .List ;
10
10
11
11
public enum MessageQueueConnections {
12
+
12
13
DB ("db" ),
13
- AMPQ ("ampq " );
14
+ AMPQ ("amqp " );
14
15
15
16
private final String type ;
16
17
@@ -32,16 +33,6 @@ public String getType() {
32
33
return type ;
33
34
}
34
35
35
- /**
36
- * Get connection type by name.
37
- *
38
- * @param typeName type name
39
- * @return Request Interface
40
- */
41
- public static String getConnectionTypeByName (final String typeName ) {
42
- return MessageQueueConnections .valueOf (typeName ).getType ();
43
- }
44
-
45
36
/**
46
37
* Get list of connection types.
47
38
*
@@ -51,7 +42,7 @@ public static List<String> getList() {
51
42
final List <String > typeList = new ArrayList <>();
52
43
53
44
for (final MessageQueueConnections type : MessageQueueConnections .values ()) {
54
- typeList .add (getConnectionTypeByName ( type .name () ));
45
+ typeList .add (type .getType ( ));
55
46
}
56
47
57
48
return typeList ;
Original file line number Diff line number Diff line change @@ -32,7 +32,13 @@ private MagentoTypeEscapeUtil() {
32
32
String result = typeFqn ;
33
33
34
34
while (matcher .find ()) {
35
- result = result .substring (0 , matcher .start (0 )) + result .substring (matcher .end (0 ));
35
+ final int begin = matcher .start (0 );
36
+ final int end = matcher .end (0 );
37
+
38
+ if (begin < 0 || begin > end || end > result .length ()) {
39
+ continue ;
40
+ }
41
+ result = result .substring (0 , begin ) + result .substring (end );
36
42
}
37
43
38
44
return typeFqn .equals (result ) ? typeFqn : result ;
You can’t perform that action at this time.
0 commit comments