I think, the code would be easier to understand if populating `tempVars` and testing whether it is empty are separated:
```java
populateVars();  // instead of matchAndFormatIsEmpty()
if (tempVars.isEmpty()) {
   // ...
}
````