Skip to content

Commit ee30c88

Browse files
committed
Исправление ошибки разбора форм и ролей
1 parent a8af664 commit ee30c88

File tree

5 files changed

+82
-69
lines changed

5 files changed

+82
-69
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ build/
1212
/.idea/sonar*
1313

1414
/.idea/misc.xml
15+
Gradle_*.xml

src/main/java/com/github/_1c_syntax/bsl/mdo/support/RoleRight.java

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
/*
2-
* This file is a part of MDClasses.
3-
*
4-
* Copyright (c) 2019 - 2024
5-
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
6-
*
7-
* SPDX-License-Identifier: LGPL-3.0-or-later
8-
*
9-
* MDClasses is free software; you can redistribute it and/or
10-
* modify it under the terms of the GNU Lesser General Public
11-
* License as published by the Free Software Foundation; either
12-
* version 3.0 of the License, or (at your option) any later version.
13-
*
14-
* MDClasses is distributed in the hope that it will be useful,
15-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17-
* Lesser General Public License for more details.
18-
*
19-
* You should have received a copy of the GNU Lesser General Public
20-
* License along with MDClasses.
21-
*/
22-
package com.github._1c_syntax.bsl.mdo.support;
1+
/*
2+
* This file is a part of MDClasses.
3+
*
4+
* Copyright (c) 2019 - 2024
5+
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
6+
*
7+
* SPDX-License-Identifier: LGPL-3.0-or-later
8+
*
9+
* MDClasses is free software; you can redistribute it and/or
10+
* modify it under the terms of the GNU Lesser General Public
11+
* License as published by the Free Software Foundation; either
12+
* version 3.0 of the License, or (at your option) any later version.
13+
*
14+
* MDClasses is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
* Lesser General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public
20+
* License along with MDClasses.
21+
*/
22+
package com.github._1c_syntax.bsl.mdo.support;
2323

2424
import lombok.AllArgsConstructor;
2525
import lombok.Getter;
@@ -96,7 +96,11 @@ public enum RoleRight implements EnumWithValue {
9696
INTERACTIVE_EXECUTE("InteractiveExecute"),
9797
TECHNICAL_SPECIALIST_MODE("TechnicalSpecialistMode"),
9898
INTERACTIVE_START("InteractiveStart"),
99-
START("Start");
99+
START("Start"),
100+
STANDARD_AUTHENTICATION_CHANGE("StandardAuthenticationChange"),
101+
SESSION_STANDARD_AUTHENTICATION_CHANGE("SessionStandardAuthenticationChange"),
102+
SESSION_OS_AUTHENTICATION_CHANGE("SessionOSAuthenticationChange")
103+
;
100104

101105
@Accessors(fluent = true)
102106
private final String value;

src/main/java/com/github/_1c_syntax/bsl/reader/common/converter/EnumConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private static <T extends Enum<T> & EnumWithValue> T fromValue(Class<T> clazz, S
4949
return item;
5050
}
5151
}
52-
throw new IllegalArgumentException(value);
52+
throw new IllegalArgumentException(clazz.getName() + " " + value);
5353
}
5454

5555
@Override

src/main/java/com/github/_1c_syntax/bsl/reader/common/xstream/ExtendXStream.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
/*
2-
* This file is a part of MDClasses.
3-
*
4-
* Copyright (c) 2019 - 2024
5-
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
6-
*
7-
* SPDX-License-Identifier: LGPL-3.0-or-later
8-
*
9-
* MDClasses is free software; you can redistribute it and/or
10-
* modify it under the terms of the GNU Lesser General Public
11-
* License as published by the Free Software Foundation; either
12-
* version 3.0 of the License, or (at your option) any later version.
13-
*
14-
* MDClasses is distributed in the hope that it will be useful,
15-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17-
* Lesser General Public License for more details.
18-
*
19-
* You should have received a copy of the GNU Lesser General Public
20-
* License along with MDClasses.
21-
*/
22-
package com.github._1c_syntax.bsl.reader.common.xstream;
1+
/*
2+
* This file is a part of MDClasses.
3+
*
4+
* Copyright (c) 2019 - 2024
5+
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
6+
*
7+
* SPDX-License-Identifier: LGPL-3.0-or-later
8+
*
9+
* MDClasses is free software; you can redistribute it and/or
10+
* modify it under the terms of the GNU Lesser General Public
11+
* License as published by the Free Software Foundation; either
12+
* version 3.0 of the License, or (at your option) any later version.
13+
*
14+
* MDClasses is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
* Lesser General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public
20+
* License along with MDClasses.
21+
*/
22+
package com.github._1c_syntax.bsl.reader.common.xstream;
2323

2424
import com.github._1c_syntax.bsl.mdclasses.ConfigurationTree;
2525
import com.github._1c_syntax.bsl.mdclasses.ExternalDataProcessor;

src/main/java/com/github/_1c_syntax/bsl/reader/designer/converter/FormElementConverter.java

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,52 @@
1-
/*
2-
* This file is a part of MDClasses.
3-
*
4-
* Copyright (c) 2019 - 2024
5-
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
6-
*
7-
* SPDX-License-Identifier: LGPL-3.0-or-later
8-
*
9-
* MDClasses is free software; you can redistribute it and/or
10-
* modify it under the terms of the GNU Lesser General Public
11-
* License as published by the Free Software Foundation; either
12-
* version 3.0 of the License, or (at your option) any later version.
13-
*
14-
* MDClasses is distributed in the hope that it will be useful,
15-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17-
* Lesser General Public License for more details.
18-
*
19-
* You should have received a copy of the GNU Lesser General Public
20-
* License along with MDClasses.
21-
*/
22-
package com.github._1c_syntax.bsl.reader.designer.converter;
1+
/*
2+
* This file is a part of MDClasses.
3+
*
4+
* Copyright (c) 2019 - 2024
5+
* Tymko Oleg <olegtymko@yandex.ru>, Maximov Valery <maximovvalery@gmail.com> and contributors
6+
*
7+
* SPDX-License-Identifier: LGPL-3.0-or-later
8+
*
9+
* MDClasses is free software; you can redistribute it and/or
10+
* modify it under the terms of the GNU Lesser General Public
11+
* License as published by the Free Software Foundation; either
12+
* version 3.0 of the License, or (at your option) any later version.
13+
*
14+
* MDClasses is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17+
* Lesser General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU Lesser General Public
20+
* License along with MDClasses.
21+
*/
22+
package com.github._1c_syntax.bsl.reader.designer.converter;
2323

2424
import com.github._1c_syntax.bsl.mdo.storage.form.FormAttribute;
2525
import com.github._1c_syntax.bsl.mdo.storage.form.FormItem;
2626
import com.github._1c_syntax.bsl.reader.common.context.FormElementReaderContext;
27+
import com.github._1c_syntax.bsl.reader.common.xstream.ExtendXStream;
2728
import com.github._1c_syntax.bsl.reader.common.xstream.ReadConverter;
2829
import com.thoughtworks.xstream.converters.UnmarshallingContext;
2930
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
31+
import lombok.extern.slf4j.Slf4j;
3032

3133
/**
3234
* Конвертор элемента формы в формате конфигуратора
3335
*/
3436
@DesignerConverter
37+
@Slf4j
3538
public class FormElementConverter implements ReadConverter {
3639

3740
@Override
3841
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
3942
var readerContext = new FormElementReaderContext(reader.getNodeName(), reader);
43+
try {
44+
readerContext.setValue("id", Integer.parseInt(reader.getAttribute("id")));
45+
} catch (NumberFormatException e) {
46+
LOGGER.error("Unknown type {} in file {}", reader.getNodeName(), ExtendXStream.getCurrentPath(reader).toString());
47+
return null;
48+
}
4049
readerContext.setValue("type", reader.getNodeName());
41-
readerContext.setValue("id", Integer.parseInt(reader.getAttribute("id")));
4250
readerContext.setValue("name", reader.getAttribute("name"));
4351
Unmarshaller.unmarshal(reader, context, readerContext);
4452
return readerContext.build();

0 commit comments

Comments
 (0)