Just make them `transient`. Like this:

```
private transient String basePattern;
```