peichhorn/lombok-pg — Issue #64: Method awareness
Author: nicholas22
Created: 2011-12-23 16:05:42+00:00
State: open
Labels: Feature

A fusion of the way that val and @Validate.NotNull are implemented could create a construct e.g. "srcmeta", that would allow for the method name and argument names (perhaps other things in the future too) to be known at run-time. This is to avoid performing reflection or (more error-prone) hardcode things like method names when doing logging/tracing...

e.g.
public void add(int a, int b) {
srcmeta data= new srcmeta(); // nothing set by user, detected and set by lombok-pg

println(data.getMethodName()); // => "add"
println(data.getArgumentName(0)); // => "a"
println(data.getArgumentClass(0));
// etc...
}

I appreciate this can all be done with reflection, but this data is static really, so why take the hit?