We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sample:
message X { optional bool y = 1 [default = false]; }
X#toString prints y as "*".
Problem in org.stringtemplate.v4.misc.MapModelAdaptor used by code generator.
public class MapModelAdaptor implements ModelAdaptor { @Override public Object getProperty(Interpreter interp, ST self, Object o, Object property, String propertyName) throws STNoSuchPropertyException { Object value; Map<?, ?> map = (Map<?, ?>)o; if ( property==null ) value = map.get(STGroup.DEFAULT_KEY); else if ( property.equals("keys") ) value = map.keySet(); else if ( property.equals("values") ) value = map.values(); else if ( map.containsKey(property) ) value = map.get(property); else if ( map.containsKey(propertyName) ) { // if can't find the key, try toString version value = map.get(propertyName); } else value = map.get(STGroup.DEFAULT_KEY); // not found, use default if ( value == STGroup.DICT_KEY ) { value = property; } return value; } }
When it does property lookup in a map, it also checks "default" (STGroup.DEFAULT_KEY) key. Unfortunately it is also used in protobuf as an option key.
As a result, all fields with "default" value will be masked as "*".
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Sample:
X#toString prints y as "*".
Problem in org.stringtemplate.v4.misc.MapModelAdaptor used by code generator.
When it does property lookup in a map, it also checks "default" (STGroup.DEFAULT_KEY) key. Unfortunately it is also used in protobuf as an option key.
As a result, all fields with "default" value will be masked as "*".
The text was updated successfully, but these errors were encountered: