stag-java
stag-java copied to clipboard
Stag should not require compiler argument for hungarian notation
Issue Summary
Currently, it is required to pass an argument to the annotation processor if you wish to use hungarian notation when naming your java getters an setters.
Reproduction Steps
Create the following model
@UseStag
class Test {
private String mField;
public void setField(String field) { ... }
public String getField() { ... }
}
and do NOT pass the hungarian naming parameter to the annotation processor.
Expected Behavior
Ideally, you should be able to name your setters as above
Actual Behavior
You are warned that setters and getters are not found and compilation fails.
Potential solutions
- Check for hungarian and non hungarian named methods
- downside: namespace collisions
- downside: potential non-determinism when both hungarian and non-hungarian names exist
- upside: consumer doesn't have to provide compiler argument
- Option in class level
@UseStag
annotation- downside: verbose, consumer has to provide option in every class using the naming scheme
- upside: localized, easier to consume than compiler argument
- upside: very deterministic
cc @kvenn