Skip to content

Commit 5078b99

Browse files
committed
refactor: fix compilation error
1 parent 311529c commit 5078b99

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

core/flamingock-processor/src/main/java/io/flamingock/core/processor/FlamingockAnnotationProcessor.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,15 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
209209
List<CodePreviewChange> legacyChanges = allChanges.stream().filter(CodePreviewChange::isLegacy).collect(Collectors.toList());
210210
List<CodePreviewChange> standardChanges = allChanges.stream().filter(TaskDescriptor::isStandard).collect(Collectors.toList());
211211

212+
Map<String, List<CodePreviewChange>> standardChangesMapByPackage = getCodeChangesMapByPackage(standardChanges);
212213
PreviewPipeline pipeline = getPipelineFromProcessChanges(
213214
systemChanges,
214215
legacyChanges,
215-
getCodeChangesMapByPackage(standardChanges),
216+
standardChangesMapByPackage,
216217
flamingockAnnotation
217218
);
218219

219-
validateAllChangesAreMappedToStages(legacyChanges, noLegacyChangesByPackage, pipeline, flamingockAnnotation.strictStageMapping());
220+
validateAllChangesAreMappedToStages(standardChangesMapByPackage, pipeline, flamingockAnnotation.strictStageMapping());
220221

221222
Serializer serializer = new Serializer(processingEnv, logger);
222223
String setup = flamingockAnnotation.setup().toString();
@@ -681,16 +682,14 @@ private void validateConfiguration(EnableFlamingock pipelineAnnotation, boolean
681682
* It checks package names from the changes map against the pipeline stages' sourcesPackage
682683
* (including the SYSTEM stage). If any stage does not represent any package, a RuntimeException is thrown.
683684
*
684-
* @param legacyCodedChanges legacy code changes (kept for completeness; not used for package mapping)
685-
* @param noLegacyCodedChangesByPackage non-legacy changes grouped by source package
685+
* @param standardChanges non-legacy changes grouped by source package
686686
* @param pipeline built preview pipeline
687687
* @param strictStageMapping if true, unmapped changes will throw an exception; if false, will log a warning
688688
*/
689-
private void validateAllChangesAreMappedToStages(List<CodePreviewChange> legacyCodedChanges,
690-
Map<String, List<CodePreviewChange>> noLegacyCodedChangesByPackage,
689+
private void validateAllChangesAreMappedToStages(Map<String, List<CodePreviewChange>> standardChanges,
691690
PreviewPipeline pipeline,
692691
Boolean strictStageMapping) {
693-
if (noLegacyCodedChangesByPackage == null || noLegacyCodedChangesByPackage.isEmpty()) {
692+
if (standardChanges == null || standardChanges.isEmpty()) {
694693
return;
695694
}
696695

@@ -702,7 +701,7 @@ private void validateAllChangesAreMappedToStages(List<CodePreviewChange> legacyC
702701

703702
List<String> unmapped = new ArrayList<>();
704703

705-
for (String pkg : noLegacyCodedChangesByPackage.keySet()) {
704+
for (String pkg : standardChanges.keySet()) {
706705
if (pkg == null) {
707706
continue;
708707
}

0 commit comments

Comments
 (0)