From 703e4e3e6c2ea6310b5497d05fb1ea9cecf40505 Mon Sep 17 00:00:00 2001 From: "diego.marcilio" Date: Fri, 2 Dec 2022 12:18:45 +0000 Subject: [PATCH] Failing test for Java `delete_all_statements_after_return` --- .../expected/XPFlagCleanerPositiveCases.java | 4 ++++ .../control/input/XPFlagCleanerPositiveCases.java | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/polyglot/piranha/test-resources/java/feature_flag_system_1/control/expected/XPFlagCleanerPositiveCases.java b/polyglot/piranha/test-resources/java/feature_flag_system_1/control/expected/XPFlagCleanerPositiveCases.java index 2670bd921..6b09cbf00 100644 --- a/polyglot/piranha/test-resources/java/feature_flag_system_1/control/expected/XPFlagCleanerPositiveCases.java +++ b/polyglot/piranha/test-resources/java/feature_flag_system_1/control/expected/XPFlagCleanerPositiveCases.java @@ -205,6 +205,10 @@ public int remove_else_if(boolean extra_toggle) { } } + public String multiple_stmt_after_return() { + return "not enabled"; + } + class XPTest { public boolean isToggleEnabled(TestExperimentName x) { return true; diff --git a/polyglot/piranha/test-resources/java/feature_flag_system_1/control/input/XPFlagCleanerPositiveCases.java b/polyglot/piranha/test-resources/java/feature_flag_system_1/control/input/XPFlagCleanerPositiveCases.java index db45b9c76..eaa962d93 100644 --- a/polyglot/piranha/test-resources/java/feature_flag_system_1/control/input/XPFlagCleanerPositiveCases.java +++ b/polyglot/piranha/test-resources/java/feature_flag_system_1/control/input/XPFlagCleanerPositiveCases.java @@ -267,6 +267,19 @@ public int remove_else_if(boolean extra_toggle) { } } + public String multiple_stmt_after_return() { + if (!experimentation.isToggleEnabled(TestExperimentName.STALE_FLAG)) { + return "not enabled"; + } + + System.out.println("remove 1"); + System.out.println("remove 2"); + System.out.println("remove 3"); + System.out.println("remove 4"); + System.out.println("remove 5"); + return "enabled"; + } + class XPTest { public boolean isToggleEnabled(TestExperimentName x) { return true;