27
27
import com .github ._1c_syntax .bsl .reader .common .xstream .ExtendXStream ;
28
28
import com .github ._1c_syntax .bsl .reader .common .xstream .ReadConverter ;
29
29
import com .github ._1c_syntax .bsl .types .MDOType ;
30
+ import com .github ._1c_syntax .utils .CaseInsensitivePattern ;
30
31
import com .thoughtworks .xstream .converters .UnmarshallingContext ;
31
32
import com .thoughtworks .xstream .io .HierarchicalStreamReader ;
32
33
import org .apache .commons .io .FilenameUtils ;
33
34
34
35
import java .nio .file .Path ;
35
36
import java .nio .file .Paths ;
37
+ import java .util .regex .Pattern ;
36
38
37
39
import static java .util .Objects .requireNonNull ;
38
40
@@ -44,7 +46,7 @@ public class SubsystemConverter implements ReadConverter {
44
46
45
47
private static final String START_MDOREF_NAME = MDOType .SUBSYSTEM .getName () + "." ;
46
48
private static final int COUNT_PARTS = 2 ;
47
- private static final String NAME_SPLITTER = "[\\ \\ /]" + MDOType .SUBSYSTEM .getGroupName () + "[\\ \\ /]" ;
49
+ private static final Pattern NAME_SPLITTER_PATTERN = CaseInsensitivePattern . compile ( "[\\ \\ /]" + MDOType .SUBSYSTEM .getGroupName () + "[\\ \\ /]" ) ;
48
50
49
51
@ Override
50
52
public Object unmarshal (HierarchicalStreamReader reader , UnmarshallingContext context ) {
@@ -64,7 +66,7 @@ public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext co
64
66
65
67
// определим это самостоятельная или дочерняя
66
68
// у дочерней будет несколько вложенных папок подсистемы
67
- if (localRootPath .split (NAME_SPLITTER ).length > COUNT_PARTS ) {
69
+ if (NAME_SPLITTER_PATTERN .split (localRootPath ).length > COUNT_PARTS ) {
68
70
return readerContext ;
69
71
} else {
70
72
return readerContext .build ();
0 commit comments