[*] Remove lombok.var for better compatibility

This commit is contained in:
2025-07-28 21:37:15 +02:00
parent 7c253a73b3
commit 20e08349e7
8 changed files with 27 additions and 31 deletions

View File

@@ -4,7 +4,6 @@ import de.siphalor.tweed5.annotationinheritance.impl.AnnotationInheritanceResolv
import de.siphalor.tweed5.typeutils.api.annotations.AnnotationRepeatType;
import de.siphalor.tweed5.utils.api.collection.ClassToInstanceMap;
import lombok.RequiredArgsConstructor;
import lombok.var;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.NonNull;
@@ -62,7 +61,8 @@ public class AnnotationInheritanceAwareAnnotatedElement implements AnnotatedElem
AnnotationRepeatType repeatType = AnnotationRepeatType.getType(annotationClass);
if (repeatType instanceof AnnotationRepeatType.Repeatable) {
var containerRepeatType = ((AnnotationRepeatType.Repeatable) repeatType).containerRepeatType();
AnnotationRepeatType.RepeatableContainer containerRepeatType =
((AnnotationRepeatType.Repeatable) repeatType).containerRepeatType();
Annotation containerAnnotation = getOrResolveAnnotations().get(containerRepeatType.annotationClass());
if (containerAnnotation != null) {
return containerRepeatType.elements(containerAnnotation);

View File

@@ -3,7 +3,6 @@ package de.siphalor.tweed5.attributesextension.impl;
import de.siphalor.tweed5.attributesextension.api.AttributesExtension;
import de.siphalor.tweed5.attributesextension.api.AttributesRelatedExtension;
import de.siphalor.tweed5.core.api.container.ConfigContainer;
import de.siphalor.tweed5.core.api.container.ConfigContainerSetupPhase;
import de.siphalor.tweed5.core.api.entry.ConfigEntry;
import de.siphalor.tweed5.core.api.entry.ConfigEntryVisitor;
import de.siphalor.tweed5.core.api.extension.TweedExtension;
@@ -11,7 +10,6 @@ import de.siphalor.tweed5.core.api.extension.TweedExtensionSetupContext;
import de.siphalor.tweed5.patchwork.api.PatchworkPartAccess;
import de.siphalor.tweed5.utils.api.collection.ImmutableArrayBackedMap;
import lombok.Data;
import lombok.var;
import org.jspecify.annotations.Nullable;
import java.util.*;
@@ -30,7 +28,7 @@ public class AttributesExtensionImpl implements AttributesExtension {
public void setAttribute(ConfigEntry<?> entry, String key, List<String> values) {
requireEditable();
var attributes = getOrCreateEditableAttributes(entry);
Map<String, List<String>> attributes = getOrCreateEditableAttributes(entry);
attributes.compute(key, (k, existingValues) -> {
if (existingValues == null) {
@@ -46,7 +44,7 @@ public class AttributesExtensionImpl implements AttributesExtension {
public void setAttributeDefault(ConfigEntry<?> entry, String key, List<String> values) {
requireEditable();
var attributeDefaults = getOrCreateEditableAttributeDefaults(entry);
Map<String, List<String>> attributeDefaults = getOrCreateEditableAttributeDefaults(entry);
attributeDefaults.compute(key, (k, existingValues) -> {
if (existingValues == null) {
@@ -66,7 +64,7 @@ public class AttributesExtensionImpl implements AttributesExtension {
private Map<String, List<String>> getOrCreateEditableAttributes(ConfigEntry<?> entry) {
CustomEntryData data = getOrCreateCustomEntryData(entry);
var attributes = data.attributes();
Map<String, List<String>> attributes = data.attributes();
if (attributes == null) {
attributes = new HashMap<>();
data.attributes(attributes);
@@ -76,7 +74,7 @@ public class AttributesExtensionImpl implements AttributesExtension {
private Map<String, List<String>> getOrCreateEditableAttributeDefaults(ConfigEntry<?> entry) {
CustomEntryData data = getOrCreateCustomEntryData(entry);
var attributeDefaults = data.attributeDefaults();
Map<String, List<String>> attributeDefaults = data.attributeDefaults();
if (attributeDefaults == null) {
attributeDefaults = new HashMap<>();
data.attributeDefaults(attributeDefaults);
@@ -113,13 +111,13 @@ public class AttributesExtensionImpl implements AttributesExtension {
}
private void enterEntry(ConfigEntry<?> entry) {
var data = entry.extensionsData().get(dataAccess);
var currentDefaults = defaults.getFirst();
CustomEntryData data = entry.extensionsData().get(dataAccess);
Map<String, List<String>> currentDefaults = defaults.getFirst();
if (data == null) {
defaults.push(currentDefaults);
return;
}
var entryDefaults = data.attributeDefaults();
Map<String, List<String>> entryDefaults = data.attributeDefaults();
data.attributeDefaults(null);
if (entryDefaults == null || entryDefaults.isEmpty()) {
defaults.push(currentDefaults);
@@ -143,8 +141,8 @@ public class AttributesExtensionImpl implements AttributesExtension {
@Override
public void visitEntry(ConfigEntry<?> entry) {
var data = getOrCreateCustomEntryData(entry);
var currentDefaults = defaults.getFirst();
CustomEntryData data = getOrCreateCustomEntryData(entry);
Map<String, List<String>> currentDefaults = defaults.getFirst();
if (data.attributes() == null || data.attributes().isEmpty()) {
data.attributes(currentDefaults);
} else {

View File

@@ -27,7 +27,6 @@ import de.siphalor.tweed5.utils.api.UniqueSymbol;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.var;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;
@@ -133,7 +132,7 @@ public class AttributesReadWriteFilterExtensionImpl
public void addFilter(Patchwork contextExtensionsData, String key, String value) {
requireInitialized();
var contextCustomData = getOrCreateReadWriteContextCustomData(contextExtensionsData);
ReadWriteContextCustomData contextCustomData = getOrCreateReadWriteContextCustomData(contextExtensionsData);
addFilterToRWContextData(key, value, contextCustomData);
}

View File

@@ -14,7 +14,6 @@ import de.siphalor.tweed5.defaultextensions.pather.api.PathTrackingDataVisitor;
import de.siphalor.tweed5.defaultextensions.pather.api.PatherExtension;
import de.siphalor.tweed5.patchwork.api.PatchworkPartAccess;
import lombok.val;
import lombok.var;
import org.jspecify.annotations.NonNull;
import org.jspecify.annotations.Nullable;
@@ -76,7 +75,7 @@ public class PatherExtensionImpl implements PatherExtension, ReadWriteRelatedExt
try {
return castedInner.read(new PathTrackingDataReader(reader, pathTracking), entry, context);
} catch (TweedEntryReadException e) {
var exceptionPathTracking = e.context().extensionsData().get(rwContextPathTrackingAccess);
val exceptionPathTracking = e.context().extensionsData().get(rwContextPathTrackingAccess);
if (exceptionPathTracking != null) {
throw new TweedEntryReadException(
"Exception while reading entry at "
@@ -119,7 +118,7 @@ public class PatherExtensionImpl implements PatherExtension, ReadWriteRelatedExt
try {
castedInner.write(new PathTrackingDataVisitor(writer, pathTracking), value, entry, context);
} catch (TweedEntryWriteException e) {
var exceptionPathTracking = e.context().extensionsData().get(rwContextPathTrackingAccess);
val exceptionPathTracking = e.context().extensionsData().get(rwContextPathTrackingAccess);
if (exceptionPathTracking != null) {
throw new TweedEntryWriteException(
"Exception while writing entry at "

View File

@@ -9,7 +9,7 @@ import de.siphalor.tweed5.dataapi.api.*;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.var;
import lombok.val;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.Nullable;
@@ -181,7 +181,7 @@ public class TweedEntryReaderWriterImpls {
NOOP_READER_WRITER.read(reader, null, context);
continue;
}
var subEntryReaderChain = context.readWriteExtension().getReaderChain(subEntry);
val subEntryReaderChain = context.readWriteExtension().getReaderChain(subEntry);
Object subEntryValue = subEntryReaderChain.read(reader, subEntry, context);
entry.set(compoundValue, key, subEntryValue);
} else {

View File

@@ -6,7 +6,7 @@ import de.siphalor.tweed5.core.api.entry.ConfigEntry;
import de.siphalor.tweed5.typeutils.api.type.ActualType;
import de.siphalor.tweed5.weaver.pojo.api.weaving.TweedPojoWeavingExtension;
import de.siphalor.tweed5.weaver.pojo.api.weaving.WeavingContext;
import lombok.var;
import lombok.val;
import org.jetbrains.annotations.ApiStatus;
import java.util.*;
@@ -31,12 +31,12 @@ public class AttributesPojoWeavingProcessor implements TweedPojoWeavingExtension
@Override
public <T> void afterWeaveEntry(ActualType<T> valueType, ConfigEntry<T> configEntry, WeavingContext context) {
var attributeAnnotations = context.annotations().getAnnotationsByType(Attribute.class);
var attributes = collectAttributesFromAnnotations(attributeAnnotations, Attribute::key, Attribute::values);
val attributeAnnotations = context.annotations().getAnnotationsByType(Attribute.class);
val attributes = collectAttributesFromAnnotations(attributeAnnotations, Attribute::key, Attribute::values);
attributes.forEach((key, values) -> attributesExtension.setAttribute(configEntry, key, values));
var attributeDefaultAnnotations = context.annotations().getAnnotationsByType(AttributeDefault.class);
var attributeDefaults = collectAttributesFromAnnotations(
val attributeDefaultAnnotations = context.annotations().getAnnotationsByType(AttributeDefault.class);
val attributeDefaults = collectAttributesFromAnnotations(
attributeDefaultAnnotations,
AttributeDefault::key,
AttributeDefault::defaultValue

View File

@@ -11,7 +11,7 @@ import de.siphalor.tweed5.weaver.pojo.api.weaving.ProtoWeavingContext;
import de.siphalor.tweed5.weaver.pojo.api.weaving.TweedPojoWeavingExtension;
import de.siphalor.tweed5.weaver.pojo.api.weaving.WeavingContext;
import lombok.Value;
import lombok.var;
import lombok.val;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.Nullable;
@@ -41,7 +41,7 @@ public class AutoNullableReadWritePojoWeavingProcessor implements TweedPojoWeavi
AutoReadWriteNullability innerNullability = null;
var behavior = context.annotations().getAnnotation(AutoNullableReadWriteBehavior.class);
val behavior = context.annotations().getAnnotation(AutoNullableReadWriteBehavior.class);
if (behavior != null) {
innerNullability = behavior.defaultNullability();
}
@@ -67,14 +67,14 @@ public class AutoNullableReadWritePojoWeavingProcessor implements TweedPojoWeavi
@Override
public <T> void afterWeaveEntry(ActualType<T> valueType, ConfigEntry<T> configEntry, WeavingContext context) {
if (getNullability(valueType, context) == AutoReadWriteNullability.NULLABLE) {
var definedEntryReader = readWriteExtension.getDefinedEntryReader(configEntry);
val definedEntryReader = readWriteExtension.getDefinedEntryReader(configEntry);
if (definedEntryReader != null) {
readWriteExtension.setEntryReader(
configEntry,
new TweedEntryReaderWriterImpls.NullableReader<>(definedEntryReader)
);
}
var definedEntryWriter = readWriteExtension.getDefinedEntryWriter(configEntry);
val definedEntryWriter = readWriteExtension.getDefinedEntryWriter(configEntry);
if (definedEntryWriter != null) {
readWriteExtension.setEntryWriter(
configEntry,

View File

@@ -8,7 +8,7 @@ import de.siphalor.tweed5.defaultextensions.validation.api.validators.NumberRang
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import lombok.var;
import lombok.val;
import org.jetbrains.annotations.ApiStatus;
import java.util.regex.Matcher;
@@ -43,7 +43,7 @@ public class WeavableNumberRangeValidator implements WeavableConfigEntryValidato
//noinspection unchecked
Class<? extends Number> numberClass = boxClass((Class<? extends Number>) configEntry.valueClass());
//noinspection unchecked
var builder = NumberRangeValidator.builder((Class<Number>) numberClass);
val builder = NumberRangeValidator.builder((Class<Number>) numberClass);
String minGroup = matcher.group(1);
if (minGroup != null) {