Skip to content

Commit 099525b

Browse files
committed
sq fixes
1 parent 08d0feb commit 099525b

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

src/main/java/com/github/_1c_syntax/bsl/reader/common/context/AbstractReaderContext.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,21 @@ protected AbstractReaderContext(HierarchicalStreamReader reader) {
128128
mdReader = ExtendXStream.getCurrentMDReader(reader);
129129

130130
cache = new ConcurrentHashMap<>();
131+
mdoType = MDOType.UNKNOWN;
132+
supportVariant = SupportVariant.NONE;
133+
realClass = String.class; // заглушка
134+
builder = ""; // заглушка
131135
}
132136

133137
protected AbstractReaderContext(Path currentPath, MDReader mdReader) {
134138
this.currentPath = currentPath;
135139
this.mdReader = mdReader;
136140

137141
cache = new ConcurrentHashMap<>();
142+
mdoType = MDOType.UNKNOWN;
143+
supportVariant = SupportVariant.NONE;
144+
realClass = String.class; // заглушка
145+
builder = ""; // заглушка
138146
}
139147

140148
/**
@@ -173,8 +181,7 @@ public void setValue(String methodName, @Nullable Object value) {
173181
* @param fieldName Имя поля\метода
174182
* @return Определенный класс, если не найден, тогда null
175183
*/
176-
@Nullable
177-
public Class<?> fieldType(String fieldName) {
184+
public @Nullable Class<?> fieldType(String fieldName) {
178185
return (Class<?>) TransformationUtils.fieldType(builder, fieldName);
179186
}
180187

src/main/java/com/github/_1c_syntax/bsl/reader/common/context/FormElementReaderContext.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ public FormElementReaderContext(String elementName, HierarchicalStreamReader rea
6666
}
6767

6868
@Override
69-
@Nullable
70-
public Class<?> fieldType(String fieldName) {
69+
public @Nullable Class<?> fieldType(String fieldName) {
7170
var clazz = CLASSES.get(fieldName);
7271
if (clazz == null) {
7372
clazz = super.fieldType(fieldName);

src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDCReaderContext.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ public MDCReaderContext(Class<?> clazz, HierarchicalStreamReader reader) {
8383
supportVariant = SupportVariant.NONE;
8484
}
8585
mdoType = MDOType.CONFIGURATION;
86+
configurationExtensionCompatibilityMode = new CompatibilityMode();
8687

87-
setValue(UUID_FIELD_NAME, uuid);
88-
setValue(SUPPORT_VALIANT_FIELD_NAME, supportVariant);
88+
super.setValue(UUID_FIELD_NAME, uuid);
89+
super.setValue(SUPPORT_VALIANT_FIELD_NAME, supportVariant);
8990

9091
childrenNames = Collections.synchronizedList(new ArrayList<>());
9192
}

src/main/java/com/github/_1c_syntax/bsl/reader/common/context/MDReaderContext.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ public MDReaderContext(HierarchicalStreamReader reader) {
109109
mdoType = MDOType.fromValue(realClassName).orElse(MDOType.UNKNOWN);
110110
}
111111

112-
setValue(UUID_FIELD_NAME, uuid);
113-
setValue(SUPPORT_VALIANT_FIELD_NAME, supportVariant);
112+
templateType = TemplateType.UNKNOWN;
113+
super.setValue(UUID_FIELD_NAME, uuid);
114+
super.setValue(SUPPORT_VALIANT_FIELD_NAME, supportVariant);
114115

115116
childrenContexts = new ConcurrentHashMap<>();
116117
}
@@ -121,6 +122,7 @@ public MDReaderContext(Path currentPath,
121122
realClass = StandardAttribute.class;
122123
builder = TransformationUtils.builder(realClass);
123124
mdoType = MDOType.STANDARD_ATTRIBUTE;
125+
templateType = TemplateType.UNKNOWN;
124126
childrenContexts = new ConcurrentHashMap<>();
125127
}
126128

0 commit comments

Comments
 (0)