mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 04:15:06 +00:00
[fixes #3931] Proper output for config tool addNullAnnotations
This commit is contained in:
1 parent
87e8af476a
commit
7eee00a0b4
4 files changed
+52
-4
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 The Project Lombok Authors.
|
||||
* Copyright (C) 2020-2025 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -156,4 +156,8 @@ public final class NullAnnotationLibrary implements ConfigurationValueType {
|
||||
if (atStart) throw new IllegalArgumentException(MSG + fqn);
|
||||
return fqn;
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
config.stopBubbling=true
|
||||
|
||||
lombok.addNullAnnotations = jspecify
|
||||
@@ -32,6 +32,9 @@ lombok.copyableAnnotations += copy1
|
||||
# BASE/d1/d11/lombok.config (stopped bubbling):
|
||||
# 7: lombok.copyableAnnotations += copy1
|
||||
|
||||
# Generate some style of null annotation for generated code where this is relevant. (default: none).
|
||||
clear lombok.addNullAnnotations
|
||||
|
||||
|
||||
Configuration for:
|
||||
- BASE/d1/d11/d111
|
||||
@@ -101,6 +104,9 @@ lombok.copyableAnnotations += copy2
|
||||
# BASE/d1/d11/d111/lombok.config:
|
||||
# 5: lombok.copyableAnnotations += copy2
|
||||
|
||||
# Generate some style of null annotation for generated code where this is relevant. (default: none).
|
||||
clear lombok.addNullAnnotations
|
||||
|
||||
|
||||
Configuration for 'BASE/d1/d12'.
|
||||
|
||||
@@ -129,3 +135,38 @@ clear lombok.log.fieldName
|
||||
|
||||
# Copy these annotations to getters, setters, with methods, builder-setters, etc.
|
||||
clear lombok.copyableAnnotations
|
||||
|
||||
# Generate some style of null annotation for generated code where this is relevant. (default: none).
|
||||
clear lombok.addNullAnnotations
|
||||
|
||||
|
||||
Configuration for 'BASE/features/annotations'.
|
||||
|
||||
# Emit a warning or error if @Accessors is used.
|
||||
clear lombok.accessors.flagUsage
|
||||
|
||||
# Generate setters that return 'this' instead of 'void' (default: false).
|
||||
clear lombok.accessors.chain
|
||||
|
||||
# Strip this field prefix, like 'f' or 'm_', from the names of generated getters, setters, and with-ers.
|
||||
clear lombok.accessors.prefix
|
||||
|
||||
# Generate @javax.annotation.Generated on all generated code (default: false). Deprecated, use 'lombok.addJavaxGeneratedAnnotation' instead.
|
||||
clear lombok.addGeneratedAnnotation
|
||||
|
||||
# Generate @javax.annotation.Generated on all generated code (default: follow lombok.addGeneratedAnnotation).
|
||||
clear lombok.addJavaxGeneratedAnnotation
|
||||
|
||||
# Generate @ConstructorProperties for generated constructors (default: false).
|
||||
clear lombok.anyConstructor.addConstructorProperties
|
||||
|
||||
# Use this name for the generated logger fields (default: 'log').
|
||||
clear lombok.log.fieldName
|
||||
|
||||
# Copy these annotations to getters, setters, with methods, builder-setters, etc.
|
||||
clear lombok.copyableAnnotations
|
||||
|
||||
# Generate some style of null annotation for generated code where this is relevant. (default: none).
|
||||
lombok.addNullAnnotations = jspecify
|
||||
# BASE/features/annotations/lombok.config (stopped bubbling):
|
||||
# 3: lombok.addNullAnnotations = jspecify
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2014-2020 The Project Lombok Authors.
|
||||
* Copyright (C) 2014-2025 The Project Lombok Authors.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -40,12 +40,12 @@ public class TestConfiguration {
|
||||
public void testDisplayVerbose() throws Exception {
|
||||
|
||||
@SuppressWarnings(value = {"all", "unchecked", "deprecation"})
|
||||
Collection<ConfigurationKey<?>> keys = Arrays.asList(ACCESSORS_FLAG_USAGE, ACCESSORS_CHAIN, ACCESSORS_PREFIX, ADD_GENERATED_ANNOTATIONS, ADD_JAVAX_GENERATED_ANNOTATIONS, ANY_CONSTRUCTOR_ADD_CONSTRUCTOR_PROPERTIES, LOG_ANY_FIELD_NAME, COPYABLE_ANNOTATIONS);
|
||||
Collection<ConfigurationKey<?>> keys = Arrays.asList(ACCESSORS_FLAG_USAGE, ACCESSORS_CHAIN, ACCESSORS_PREFIX, ADD_GENERATED_ANNOTATIONS, ADD_JAVAX_GENERATED_ANNOTATIONS, ANY_CONSTRUCTOR_ADD_CONSTRUCTOR_PROPERTIES, LOG_ANY_FIELD_NAME, COPYABLE_ANNOTATIONS, ADD_NULL_ANNOTATIONS);
|
||||
|
||||
String baseName = "test/configuration/resource/configurationRoot/";
|
||||
File directory = new File(baseName);
|
||||
String normalizedName = new File(directory.getAbsoluteFile().toURI().normalize()).toString().replace('\\', '/') + "/";
|
||||
Collection<String> paths = Arrays.asList(normalizedName + "d1/d11", normalizedName + "d1/d12", normalizedName + "d1/d11/d111", normalizedName + "d1/d11/d111/f1.txt");
|
||||
Collection<String> paths = Arrays.asList(normalizedName + "d1/d11", normalizedName + "d1/d12", normalizedName + "d1/d11/d111", normalizedName + "d1/d11/d111/f1.txt", normalizedName + "features/annotations");
|
||||
|
||||
ByteArrayOutputStream rawOut = new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream rawErr = new ByteArrayOutputStream();
|
||||
|
||||
Reference in new issue
Block a user