2. In Emitter, why not just:
ESCAPE_REPLACEMENTS.put ( '\0', "0" );
instead of using Character.valueOf() every time. Autoboxing uses
valueOf() automatically, so the code is equivalent, just cleaner.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to snakeya...@googlegroups.com
1. Applied
2. Applied
The tools say that new Character() is no efficient because it always creates an object, while Character.valueOf() get the value from the cache for first 256 characters. Since we use a static data structure the performance is not important at all. Readability is more important
3. The tools say that final class does not need to have final modifiers for variables - the compiler will check it anyway. They were removed because they were redundant
4. Applied (reverted)
The tools say that to have an empty catch block is a bad practice (and I agree). Unfortunately the Java API does not allow to check whether a class is available without throwing an exception.