Java BeanGenerator property name problem with open parenthesis '('

Viewed 66

I create a BeanGenerator object and addProperties Like this.

final BeanGenerator beanGenerator = new BeanGenerator();
final Map<String, Class<?>> properties = new HashMap<>();
properties.put("name", String.class);
properties.put("`name", String.class);
properties.put("~name", String.class);
properties.put("!name", String.class);
properties.put("@name", String.class);
properties.put(")name", String.class);
properties.put("(name", String.class); // Problem !!!
BeanGenerator.addProperties(beanGenerator, properties);

It runs without any errors even if i use informal characters like `~!@#$%^&*)-+= for property name.

but when i use open parenthes ( for property name

java.lang.IllegalArgumentException: Name 'get(name' is invalid

is occurred.

Why ? and how property name can contains ( ?

1 Answers
Related