Skip to content

Commit 54779c7

Browse files
jglicktimja
andauthored
[JENKINS-33596] Delete more of UDPBroadcastThread & DNSMultiCast (#5720)
Co-authored-by: Tim Jacomb <timjacomb1+github@gmail.com>
1 parent 308ee04 commit 54779c7

File tree

7 files changed

+7
-84
lines changed

7 files changed

+7
-84
lines changed
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,15 @@
11
package hudson;
22

3-
import static hudson.init.InitMilestone.COMPLETED;
4-
5-
import hudson.init.Initializer;
6-
import java.util.logging.Logger;
7-
import jenkins.util.SystemProperties;
83
import org.kohsuke.accmod.Restricted;
94
import org.kohsuke.accmod.restrictions.NoExternalUse;
105

116
/**
12-
* Registers a DNS multi-cast service-discovery support.
13-
*
14-
* @author Kohsuke Kawaguchi
15-
* @deprecated No longer does anything.
7+
* @deprecated No longer does anything. Only here to prevent errors from old versions of tools like {@code JenkinsRule}.
168
*/
179
@Deprecated
1810
@Restricted(NoExternalUse.class)
1911
public class DNSMultiCast {
20-
private static final Logger LOGGER = Logger.getLogger(DNSMultiCast.class.getName());
21-
22-
public static boolean disabled = SystemProperties.getBoolean(DNSMultiCast.class.getName()+".disabled", true);
2312

24-
@Initializer(before=COMPLETED)
25-
public static void warn() {
26-
if (!disabled) {
27-
LOGGER.warning("DNS multicast capability has been removed from Jenkins. More information: https://www.jenkins.io/redirect/dns-multicast");
28-
}
29-
}
13+
public static boolean disabled = true;
3014

3115
}

core/src/main/java/hudson/UDPBroadcastThread.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

core/src/main/java/jenkins/model/Jenkins.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,6 @@ protected Jenkins(File root, ServletContext context) throws IOException, Interru
888888
* If non-null, use existing plugin manager. create a new one.
889889
*/
890890
@SuppressFBWarnings({
891-
"SC_START_IN_CTOR", // bug in FindBugs. It flags UDPBroadcastThread.start() call but that's for another class
892891
"ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD", // Trigger.timer
893892
"DM_EXIT" // Exit is wanted here
894893
})

core/src/main/java/jenkins/util/SystemProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
/**
5454
* Centralizes calls to {@link System#getProperty(String)} and related calls.
5555
* This allows us to get values not just from environment variables but also from
56-
* the {@link ServletContext}, so properties like {@code hudson.DNSMultiCast.disabled}
56+
* the {@link ServletContext}, so properties like {@code jenkins.whatever.Clazz.disabled}
5757
* can be set in {@code context.xml} and the app server's boot script does not
5858
* have to be changed.
5959
*
6060
* <p>This should be used to obtain hudson/jenkins "app"-level parameters
61-
* (e.g. {@code hudson.DNSMultiCast.disabled}), but not for system parameters
61+
* (e.g. {@code jenkins.whatever.Clazz.disabled}), but not for system parameters
6262
* (e.g. {@code os.name}).
6363
*
6464
* <p>If you run multiple instances of Jenkins in the same virtual machine and wish

test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ THE SOFTWARE.
8181
<dependency>
8282
<groupId>${project.groupId}</groupId>
8383
<artifactId>jenkins-test-harness</artifactId>
84-
<version>1589.vc23fca066d5c</version>
84+
<version>1626.v46b0925e70db</version>
8585
<scope>test</scope>
8686
<exclusions>
8787
<exclusion>

test/src/test/java/hudson/security/csrf/CrumbExclusionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void pathInfo() throws Exception {
6969
assertThat("error message using " + path, x.getResponse().getContentAsString(), containsString("No valid crumb was included in the request"));
7070
break;
7171
case 400: // from Jetty
72-
assertThat("error message using " + path, x.getResponse().getContentAsString(), containsString("Ambiguous path parameter in URI"));
72+
assertThat("error message using " + path, x.getResponse().getContentAsString(), containsString("Ambiguous path parameter"));
7373
break;
7474
default:
7575
fail("unexpected error code");

test/src/test/java/jenkins/security/SuspiciousRequestFilterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void denySemicolonInRequestPathByDefault() throws Exception {
4040
assertThat(Foo.getInstance().baz, is(nullValue()));
4141
assertThat(response.getStatusCode(), is(HttpServletResponse.SC_BAD_REQUEST));
4242
// Actually served by Jetty; never even gets as far as SuspiciousRequestFilter.
43-
assertThat(response.getContentAsString(), containsString("Ambiguous path parameter in URI"));
43+
assertThat(response.getContentAsString(), containsString("Ambiguous path parameter"));
4444
}
4545

4646
@Ignore("No longer passes Jetty")

0 commit comments

Comments
 (0)