1

I made a super simple example that doesn't make any sense.

public static void main(String [] args) throws IntrospectionException {
    BeanInfo info = Introspector.getBeanInfo(DemandBidType.class);
    int breakpoint = 0;
}

Here's my class:

public class DemandBidType {
    protected Boolean isDuplicateHour;
    protected Boolean test;

    public boolean isIsDuplicateHour() {
        return isDuplicateHour;
    }

    public void setIsDuplicateHour(Boolean isDuplicateHour) {
        this.isDuplicateHour = isDuplicateHour;
    }

    public Boolean getTest() {
        return test;
    }

    public void setTest(Boolean test) {
        this.test = test;
    }
}

And here is a screen shot showing the problem; the field I care about isn't being recognized as having a write method. I added another field 'test' and that one works fine... There was very little related to this on Google, and what was there was years old with older java versions. You can see in the bottom right that I'm using 1.7.51.

Debugging Screenshot(https://i.stack.imgur.com/DKC6e.png)

Basil
  • 403
  • 5
  • 14

1 Answers1

1

It turns out it's because the return type of the getter doesn't match the argument of the setter. (One's "Boolean" the other "boolean").

Basil
  • 403
  • 5
  • 14
  • How you dealed with it? I have auto-generated JAXB class and I think I can't just change method return type. – Line Jun 20 '17 at 09:56
  • 1
    Sorry this was too long ago; I don't remember. – Basil Jun 27 '17 at 17:23
  • 1
    I ended up with re-generate these classes in other way, cause I figured out that there isn't a way that Introspector get bot methods with different types at once. But this question was very helpful with investigating this problem, thanks for posting it! – Line Jun 28 '17 at 08:02