Mixermachine / base-test

Automated testing of Java classes via reflections
21 stars 3 forks source link

Regex in GetterIsSetterCheck #63

Closed svedie closed 4 years ago

svedie commented 4 years ago

Hello devs,

how can I use the regex to ignore some Checks in Getter and Setter?

I have following code:

private final Long id;

public Person(final Long pId){
this.id = pId;
)

public Long getId()
{
  return this.id;
}

public void setId(final Long pId)
{
  throw new RuntimeException();
}

How can I use the regex parameter in GetterIsSetterCheck? If I use "id", it does not ignore the methods.

Mixermachine commented 4 years ago

Hy @svedie

currently it's just me here :). I have looked into it and currently the code is quite strict here. With version 1.0.0 you need to match for (getId)|(setId) so both the getter and the setter methods. I will publish a version which only needs a single match (getId or setId).

This might take some time as my other laptop (which has the right signing keys for the release) is currently out of my reach due to the current Corona situation.

Greetings from Stuttgart

Aaron

Note to my self: Check if other methods are also affected.

svedie commented 4 years ago

Thank you Aaron! This works fine for the current situation.

Greetings from Nuremberg ;)