Adam Gent

Results 165 comments of Adam Gent

@jknack we probably could do something like the same trick we did here: https://github.com/jknack/handlebars.java/commit/a7adb1030d9dadc653f4ae89c13a28e62f8237b8#diff-9fd22b23d4adba304bdb22b65fe8094ba8b0f45943cb330a672b1dbaf52e5d97 Basically ignore field access to any class that is in the "java." or "sun." package including...

The other option is to include modern value resolvers that are module aware in a separate maven module (not java module but maven) and compile them with JDK 11/17 (E.g....

> Sorry for the delayed answer. Yes, I am asking for the `FieldValueResolver` to ignore non-public fields. Just so we are clear... that will not always work. I field can...

OK I see the issue. The cache still has members that are not accessible. ```java private Map cache(final Class clazz) { Map mcache = this.cache.get(clazz); if (mcache == null) {...

Anyway a work around is this Field Value Resolver: ```java var MY_FIELD_VALUE_RESOLVER = new FieldValueResolver() { @Override protected Set members( Class clazz) { var members = super.members(clazz); return members.stream() .filter(fw...

As I mentioned here https://github.com/jknack/handlebars.java/pull/948#issuecomment-1090529948 We really cannot change `FieldValueResolver` otherwise folks will get very bizarre behavior on upgrades to newer JDKs without any errors (ie parent contexts now taking...

Can you include some more code? Do you have field called `size` that is `protected` or `private` right? In 4.2.1 on JDK 17 you could not get the value of...

You also probably ran into this: https://github.com/jknack/handlebars.java/blob/master/handlebars/src/main/java/com/github/jknack/handlebars/ValueResolver.java#L87

Whats even worse is this at one point worked. We have some older code using a really old handlebars and SURNAME would work.

Anyway the canonical approach is to use [Instrospector.decapitalize](https://docs.oracle.com/javase/7/docs/api/java/beans/Introspector.html#decapitalize(java.lang.String)) but that only goes from method -> property name (after get or is removed).