Skip to content

Commit e2fd74e

Browse files
committed
fix
1 parent e2e8cd9 commit e2fd74e

File tree

5 files changed

+27
-38
lines changed

5 files changed

+27
-38
lines changed

src/main/java/com/github/_1c_syntax/bsl/mdo/storage/form/FormAttributeValueType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import java.util.List;
3030

31-
public class FormAttributeValueType implements ValueType {
31+
public final class FormAttributeValueType implements ValueType {
3232
public static final FormAttributeValueType VALUE_TABLE = new FormAttributeValueType("ValueTable", "ТаблицаЗначений");
3333
public static final FormAttributeValueType VALUE_TREE = new FormAttributeValueType("ValueTree", "ДеревоЗначений");
3434
public static final FormAttributeValueType VALUE_LIST = new FormAttributeValueType("ValueList", "СписокЗначений");
@@ -115,7 +115,7 @@ public ValueTypeVariant getVariant() {
115115
*
116116
* @return Список встроенных типов
117117
*/
118-
public static List<ValueType> builtinTypes() {
118+
public static List<? extends ValueType> builtinTypes() {
119119
return BUILTIN_TYPES;
120120
}
121121
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
/**
3737
* Типы данных, построенные на метаданных
3838
*/
39-
public class MetadataValueType implements ValueType {
39+
public final class MetadataValueType implements ValueType {
4040
public static final MetadataValueType ACCOUNTING_REGISTER_MANAGER = createManager(MDOType.ACCOUNTING_REGISTER);
4141
public static final MetadataValueType ACCOUNTING_REGISTER_REC_SET = createRecSet(MDOType.ACCOUNTING_REGISTER);
4242
public static final MetadataValueType ACCUMULATION_REGISTER_MANAGER = createManager(MDOType.ACCUMULATION_REGISTER);
@@ -204,7 +204,7 @@ public ValueTypeVariant getVariant() {
204204
*
205205
* @return Список встроенных типов
206206
*/
207-
public static List<ValueType> builtinTypes() {
207+
public static List<? extends ValueType> builtinTypes() {
208208
return BUILTIN_TYPES;
209209
}
210210

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private static Map<String, ValueType> builtinTypes() {
9999

100100
PrimitiveValueType.builtinTypes().forEach(valueType ->
101101
types.put(valueType.getName().toLowerCase(Locale.ROOT), valueType));
102-
types.put("xs:decimal", PrimitiveValueType.NUMBER);
102+
types.put("xs:decimal".toLowerCase(Locale.ROOT), PrimitiveValueType.NUMBER);
103103
types.put("xs:dateTime".toLowerCase(Locale.ROOT), PrimitiveValueType.DATE);
104104

105105
V8ValueType.builtinTypes().forEach(valueType ->

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext co
6565
} else if (nodeName.endsWith("Qualifiers")) {
6666
qualifiers.add(ExtendXStream.readValue(context, Qualifier.class));
6767
} else { // что-то еще
68-
LOGGER.info("Unknown type description field {}", nodeName);
68+
LOGGER.warn("Unknown type description field {}", nodeName);
6969
}
7070
reader.moveUp();
7171
}

src/test/java/com/github/_1c_syntax/bsl/examples/ValueTypeTest.java

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,7 @@ public class ValueTypeTest {
5555
}
5656
)
5757
void testCatalog(ArgumentsAccessor argumentsAccessor) {
58-
var isEDT = argumentsAccessor.getBoolean(0);
59-
var examplePackName = argumentsAccessor.getString(1);
60-
61-
Path configurationPath;
62-
if (isEDT) {
63-
configurationPath = Path.of(EXAMPLES_PATH, EDT_PATH, examplePackName, EDT_CF_PATH);
64-
} else {
65-
configurationPath = Path.of(EXAMPLES_PATH, DESIGNER_PATH, examplePackName, DESIGNER_CF_PATH);
66-
}
67-
68-
var mdc = MDClasses.createConfiguration(configurationPath, true);
69-
assertThat(mdc).isNotNull();
70-
assertThat(mdc).isInstanceOf(MDClass.class);
71-
assertThat(mdc).isInstanceOf(Configuration.class);
72-
73-
var configuration = (Configuration) mdc;
58+
var configuration = readConfiguration(argumentsAccessor);
7459

7560
var childMDO = configuration.findChild("Catalog.Справочник1");
7661
if (childMDO.isPresent() && childMDO.get() instanceof Catalog catalog) {
@@ -102,22 +87,7 @@ void testCatalog(ArgumentsAccessor argumentsAccessor) {
10287
}
10388
)
10489
void testDefinedType(ArgumentsAccessor argumentsAccessor) {
105-
var isEDT = argumentsAccessor.getBoolean(0);
106-
var examplePackName = argumentsAccessor.getString(1);
107-
108-
Path configurationPath;
109-
if (isEDT) {
110-
configurationPath = Path.of(EXAMPLES_PATH, EDT_PATH, examplePackName, EDT_CF_PATH);
111-
} else {
112-
configurationPath = Path.of(EXAMPLES_PATH, DESIGNER_PATH, examplePackName, DESIGNER_CF_PATH);
113-
}
114-
115-
var mdc = MDClasses.createConfiguration(configurationPath, true);
116-
assertThat(mdc).isNotNull();
117-
assertThat(mdc).isInstanceOf(MDClass.class);
118-
assertThat(mdc).isInstanceOf(Configuration.class);
119-
120-
var configuration = (Configuration) mdc;
90+
var configuration = readConfiguration(argumentsAccessor);
12191

12292
var childMDO = configuration.findChild("DefinedType.ЗначениеДоступа");
12393
if (childMDO.isPresent() && childMDO.get() instanceof DefinedType definedType) {
@@ -140,4 +110,23 @@ void testDefinedType(ArgumentsAccessor argumentsAccessor) {
140110
assertThat(typeContains.getNameRu()).isEqualTo("ПеречислениеСсылка.ДополнительныеЗначенияДоступа");
141111
}
142112
}
113+
114+
private static Configuration readConfiguration(ArgumentsAccessor argumentsAccessor) {
115+
var isEDT = argumentsAccessor.getBoolean(0);
116+
var examplePackName = argumentsAccessor.getString(1);
117+
118+
Path configurationPath;
119+
if (isEDT) {
120+
configurationPath = Path.of(EXAMPLES_PATH, EDT_PATH, examplePackName, EDT_CF_PATH);
121+
} else {
122+
configurationPath = Path.of(EXAMPLES_PATH, DESIGNER_PATH, examplePackName, DESIGNER_CF_PATH);
123+
}
124+
125+
var mdc = MDClasses.createConfiguration(configurationPath, true);
126+
assertThat(mdc).isNotNull();
127+
assertThat(mdc).isInstanceOf(MDClass.class);
128+
assertThat(mdc).isInstanceOf(Configuration.class);
129+
130+
return (Configuration) mdc;
131+
}
143132
}

0 commit comments

Comments
 (0)