Remove getAutodetectMode() in MBeanExporter

After further consideration, the team has decided to remove the
getAutodetectMode() method since its return type conflicts with the
parameter type in setAutodetectMode(int), making it an invalid bean
property.

See gh-30855
This commit is contained in:
Sam Brannen
2023-07-12 10:30:38 +02:00
parent 768fc7e341
commit 07422d709e
2 changed files with 9 additions and 22 deletions

View File

@@ -446,7 +446,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
assertThatIllegalArgumentException()
.isThrownBy(() -> exporter.setAutodetectMode(-1))
.withMessage("Only values of autodetect constants allowed");
assertThat(exporter.getAutodetectMode()).isNull();
assertThat(exporter.autodetectMode).isNull();
}
@Test
@@ -454,7 +454,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
assertThatIllegalArgumentException()
.isThrownBy(() -> exporter.setAutodetectMode(5))
.withMessage("Only values of autodetect constants allowed");
assertThat(exporter.getAutodetectMode()).isNull();
assertThat(exporter.autodetectMode).isNull();
}
/**
@@ -471,7 +471,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
@Test
void setAutodetectModeToSupportedValue() {
exporter.setAutodetectMode(MBeanExporter.AUTODETECT_ASSEMBLER);
assertThat(exporter.getAutodetectMode()).isEqualTo(MBeanExporter.AUTODETECT_ASSEMBLER);
assertThat(exporter.autodetectMode).isEqualTo(MBeanExporter.AUTODETECT_ASSEMBLER);
}
@Test
@@ -479,7 +479,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
assertThatIllegalArgumentException()
.isThrownBy(() -> exporter.setAutodetectModeName(null))
.withMessage("'constantName' must not be null or blank");
assertThat(exporter.getAutodetectMode()).isNull();
assertThat(exporter.autodetectMode).isNull();
}
@Test
@@ -487,7 +487,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
assertThatIllegalArgumentException()
.isThrownBy(() -> exporter.setAutodetectModeName(""))
.withMessage("'constantName' must not be null or blank");
assertThat(exporter.getAutodetectMode()).isNull();
assertThat(exporter.autodetectMode).isNull();
}
@Test
@@ -495,7 +495,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
assertThatIllegalArgumentException()
.isThrownBy(() -> exporter.setAutodetectModeName(" \t"))
.withMessage("'constantName' must not be null or blank");
assertThat(exporter.getAutodetectMode()).isNull();
assertThat(exporter.autodetectMode).isNull();
}
@Test
@@ -503,7 +503,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
assertThatIllegalArgumentException()
.isThrownBy(() -> exporter.setAutodetectModeName("Bogus"))
.withMessage("Only autodetect constants allowed");
assertThat(exporter.getAutodetectMode()).isNull();
assertThat(exporter.autodetectMode).isNull();
}
/**
@@ -520,7 +520,7 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
@Test
void setAutodetectModeNameToSupportedValue() {
exporter.setAutodetectModeName("AUTODETECT_ASSEMBLER");
assertThat(exporter.getAutodetectMode()).isEqualTo(MBeanExporter.AUTODETECT_ASSEMBLER);
assertThat(exporter.autodetectMode).isEqualTo(MBeanExporter.AUTODETECT_ASSEMBLER);
}
@Test