jruby/jruby · error · IllegalArgumentException

Duplicate channels in reaction

Error message

Duplicate channels in reaction

What it means

Error "Duplicate channels in reaction" thrown in jruby/jruby.

Source

Thrown at core/src/main/java/org/jruby/util/Join.java:131

            for ( int i = 0 ; i < channels.length ; ++i ) {
                indices[i+1] = channels[i].ordinal();
            }
            return indices;
        }

        Reaction(Enum<?> head, Enum<?>[] channels, boolean isAsync) {
            this(toIndices(head, channels), isAsync);
        }

        Reaction(int[] indices, boolean isAsync) {
            long mask = 0;
            for ( int i = 0 ; i < indices.length ; ++i ) {
                final int index = indices[i];
                if ( index < 0 || index > 63 ) {
                    throw new IndexOutOfBoundsException();
                }
                if ( ( mask & ( 1L << index ) ) != 0 ) {
                    throw new IllegalArgumentException("Duplicate channels in reaction");
                }
                mask |= 1L << index;
            }
            this.indices = indices;
            this.mask = mask;
            if (isAsync) {
                this.asyncMask = mask;
            } else {
                this.asyncMask = mask & ~( 1L << indices[0] );
            }
        }

        abstract void dispatch(Join join, Object[] args);
    }

    public static abstract class FastReaction extends Reaction {
        public FastReaction(int[] indices) {
            super(indices.clone(), true);

View on GitHub (pinned to fb650c13e0)

Solutions

  1. The same channel was registered twice in one join reaction. Remove the duplicate channel from the reaction definition.

When it happens

Trigger: Thrown at core/src/main/java/org/jruby/util/Join.java:131 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jruby/jruby@fb650c13e0 (2026-08-23). Data as JSON: /api/errors/d090b437e2a535fa. Report an issue: GitHub.