Skip to content
Back to skills

Jade Recipe 11 17 Multicast Group Api

ASecurity

Moves JADE's multicast main-container discovery off the deprecated MulticastSocket.joinGroup(InetAddress)/leaveGroup(InetAddress) overloads that JDK 17 superseded. Agent-mode recipe: the shard contract names the file; this document defines the transform and the one argument the agent must not invent.

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 11, 2026
ai-agentsjavaapi

Works with

  • api

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add TheRealSeber/PolishedJADEite --skill jade-recipe-11-17-multicast-group-api --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Jade Recipe 11 17 Multicast Group Api?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Jade Recipe 11 17 Multicast Group Api
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/therealseber-jade-recipe-11-17-multicast-group-api/badge)](https://www.skillsdirectory.com/skills/therealseber-jade-recipe-11-17-multicast-group-api)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: jade-recipe-11-17-multicast-group-api
description: >-
  Moves JADE's multicast main-container discovery off the deprecated
  MulticastSocket.joinGroup(InetAddress)/leaveGroup(InetAddress) overloads that
  JDK 17 superseded. Agent-mode recipe: the shard contract names the file; this
  document defines the transform and the one argument the agent must not invent.
mode: agent
arguments: [--shard-json]
---
# jade-recipe-11-17-multicast-group-api — multicast moved to DatagramSocket

JDK 17 (JDK-8237352) added `joinGroup`/`leaveGroup` to `java.net.DatagramSocket`
and notes that "the `MulticastSocket` API works as before, although most of its
methods are deprecated". This is a plain deprecation, not a removal and not a
behaviour change, which is why the rule is `LOW`.

## Scope of one task

You receive a shard contract. This rule is `blast_class: body-local`
(`parallel_safe: true`). Edit only that shard's `editable_files`;
`read_only_context` is read-only.

## The two sites

Both are in `src/jade/src/jade/core/MulticastMainDetectionListener.java`, on the
private `MulticastSocket socket` field declared at line 28:

| line | construct | enclosing |
|---|---|---|
| 50 | `socket.joinGroup(mcastGroupAddress);` | constructor setup block |
| 67 | `socket.leaveGroup(mcastGroupAddress);` | `stop()` |

They are a pair. Change both or neither.

## The transform

```java
socket.joinGroup(new InetSocketAddress(mcastGroupAddress, 0), null);
socket.leaveGroup(new InetSocketAddress(mcastGroupAddress, 0), null);
```

`java.net.InetSocketAddress` must be imported if it is not already. The
enclosing method signatures and the field type do not change.

## The argument the agent must not invent

The replacement overload takes a `NetworkInterface`. Passing `null` is the
faithful translation: it reproduces exactly what the deprecated overload did,
namely defer to the interface set by `setInterface` or, failing that, the system
default. Naming a specific interface would change which NIC JADE discovers on,
which is a deployment decision belonging to whoever runs the platform.

Pass `null`. Do not read a NIC name from a profile property, do not enumerate
`NetworkInterface.getNetworkInterfaces()` and pick one, and do not add a new
configuration key. If a reviewer wants an explicit interface, that is a separate
change with its own configuration surface.

Note that `MainDetectionManager` also uses a `MulticastSocket` (line 302) but
only calls `setTimeToLive`, `setSoTimeout`, `send` and `receive`; it never joins
a group, so it is not part of this rule.

## Verification

Recompiling in `jade-ant:17` reports no `[deprecation] joinGroup(InetAddress)`
or `leaveGroup(InetAddress) in MulticastSocket` warning. A two-container JADE
platform still finds its main container over multicast, and all consumers PASS.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.