Skip to content

Commit

Permalink
sq fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
theshadowco committed Mar 19, 2024
1 parent 1b6e05c commit e52e3f0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
public class FormDataPath {

/**
* ссылка на пустой элемент
* Ссылка на пустой элемент
*/
public static final FormDataPath EMPTY = new FormDataPath();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,13 @@ private MultiLanguageString intern() {

@EqualsAndHashCode
public static class Entry implements Comparable<Entry> {
private static final StringInterner stringInterner = new StringInterner();
private static final GenericInterner<Entry> interner = new GenericInterner<>();

@Getter
private final String langKey;
@Getter
private final String value;
private static final StringInterner stringInterner = new StringInterner();
private static final GenericInterner<Entry> interner = new GenericInterner<>();

private Entry(String langKey, String value) {
this.langKey = stringInterner.intern(langKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public List<MD> computeChildren(ChildrenOwner mdo) {
}

/**
* Производит расчет списка дочерних объектов исходя из типа объекта. Список включает дочерних дочерних
* Производит расчет списка дочерних объектов исходя из типа объекта. Список включает все дочерних по иерархии вниз
*
* @param mdo Объект, у которого есть дочерние элементы
* @return Немодифицируемый список дочерних объектов
Expand Down Expand Up @@ -244,7 +244,7 @@ private <T> List<T> addAll(List<T> result, List<? extends T> source) {
return Collections.unmodifiableList(source);
} else if (source.isEmpty()) {
return result;
} else if (result.getClass().getSimpleName().equals("UnmodifiableRandomAccessList")) {
} else if ("UnmodifiableRandomAccessList".equals(result.getClass().getSimpleName())) {
// todo надо придумать как красиво тип определить
List<T> newList = new ArrayList<>(result);
newList.addAll(source);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public void unmarshal(HierarchicalStreamReader reader, UnmarshallingContext cont
* @param clazz Класс для преобразования
* @return Прочитанное значение
*/
@SuppressWarnings("unchecked")
public <T> T readValue(UnmarshallingContext context, Class<T> clazz) {
return (T) context.convertAnother(clazz, clazz);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,39 @@
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2024
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*
* MDClasses is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* MDClasses is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with MDClasses.
*/
package com.github._1c_syntax.mdclasses;
/*
* This file is a part of MDClasses.
*
* Copyright (c) 2019 - 2024
* Tymko Oleg <[email protected]>, Maximov Valery <[email protected]> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*
* MDClasses is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* MDClasses is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with MDClasses.
*/
package com.github._1c_syntax.mdclasses;

import com.github._1c_syntax.bsl.reader.MDOReader;
import com.github._1c_syntax.bsl.reader.common.xstream.ReadConverter;
import com.github._1c_syntax.mdclasses.mdo.support.ValueType;
import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.io.HierarchicalStreamReader;

import java.util.stream.Collectors;

public class ValueTypeConverter implements ReadConverter {

@Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
var valueType = (ValueType) context.convertAnother(reader, ValueType.class,
MDOReader.getReflectionConverter(reader));
return valueType.getTypes().stream().map(String::intern).collect(Collectors.toList());
return valueType.getTypes().stream().map(String::intern).toList();
}

@Override
Expand Down

0 comments on commit e52e3f0

Please sign in to comment.