Dale Peakall commented on Bug HV-622

Sorry about that - wrote the test case directly into JIRA based on a rather more complex case. Here's stuff that compiles and the associated stack-trace.

SampleService.java
package test;

import javax.validation.constraints.NotNull;

public interface SampleService {
    @NotNull
    String getGreeting(@NotNull String greetee);
}
SampleServiceImpl.java
package test;

import javax.validation.constraints.NotNull;

public class SampleServiceImpl implements SampleService {
    @NotNull
    private String greeting;

    public void setGreeting(String greeting) {
        this.greeting = greeting;
    }

    @Override
    public String getGreeting(String greetee) {
        return greeting + " " + greetee;
    }
}
HibernateValidatorIssueTest.java
package test;

import javax.validation.Validation;
import javax.validation.Validator;
import org.hibernate.validator.HibernateValidator;
import org.junit.Test;

public class HibernateValidatorIssueTest {
    @Test
    public void testHibernateIssue() {
        Validator validator = Validation.byProvider(HibernateValidator.class)
            .configure()
            .buildValidatorFactory()
            .getValidator();

        SampleServiceImpl sampleService = new SampleServiceImpl();
        sampleService.setGreeting("Hello");

        validator.validate(sampleService);
    }
}

The stack trace is:

java.lang.IllegalArgumentException: wrong number of arguments
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at org.hibernate.validator.util.ReflectionHelper.getValue(ReflectionHelper.java:327)
	at org.hibernate.validator.metadata.BeanMetaConstraint.getValue(BeanMetaConstraint.java:65)
	at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:450)
	at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:397)
	at org.hibernate.validator.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:361)
	at org.hibernate.validator.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:313)
	at org.hibernate.validator.engine.ValidatorImpl.validate(ValidatorImpl.java:139)
	at test.HibernateValidatorIssueTest.testHibernateIssue(HibernateValidatorIssueTest.java:19)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira