Skip to content

HK2 AbstractBinders are configured twice #4256

@jeloba

Description

@jeloba

Since version 2.29 HK2 AbstractBinders are configured twice when registered directly in the application configuration. The following test demonstrates the issue:

public class HK2BinderTest extends JerseyTest
{
    @Override
    protected Application configure()
    {
        final ResourceConfig config = new ResourceConfig();

        config.register(new AbstractBinder()
        {
            private int counter = 0;

            @Override
            protected void configure()
            {
                assertThat(counter++, is(0));
            }
        });

        return config;
    }

    @Test
    public void test()
    {
    }
}

Expected behavior would be only one call to AbstractBinder.configure().

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghk2

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions