Why was org.apache.common.lang3 StringEscapeUtils deprecated?

The class was moved from package org.apache.commons.lang3 to org.apache.commons.text You can replace the deprecated library easily: In your build.gradle: implementation ‘org.apache.commons:commons-text:1.9’ And in your class using StringEscapeUtils make sure you import the correct class: import org.apache.commons.text.StringEscapeUtils; 1.9 is currently the newest version (last checked February 24th 2021) but you can check the versions at maven: … Read more

tomcat-dbcp vs commons-dbcp

Tomcat DBCP is just a renamed version of Apache Commons DBCP, with also a different internal package name prefix. At build time, Tomcat fetches the Commons DBCP sources (the version depends on the Tomcat version, for instance Tomcat 7.0.27 uses Commons DBCP 1.4), and does package name replacement (org.apache.commons -> org.apache.tomcat.dbcp) and builds the result … Read more

How to Serialize a list in java?

All standard implementations of java.util.List already implement java.io.Serializable. So even though java.util.List itself is not a subtype of java.io.Serializable, it should be safe to cast the list to Serializable, as long as you know it’s one of the standard implementations like ArrayList or LinkedList. If you’re not sure, then copy the list first (using something … Read more

Is StringUtils.EMPTY recommended?

Of course not. Do you really think “” is not clear enough ? Constants have essentially 3 use cases: Document the meaning of a value (with constant name + javadoc) Synchronize clients on a common value. Provide a shortcut to a special value to avoid some init costs None apply here.

What are the big improvements between guava and apache equivalent libraries?

First of, as javamonkey79 explained, while Google Guava and Apache Commons do share similar features, they also both have functionality that is absent from their counterpart. Thus, limiting yourself to only one library might be unwise. That being said, if I had to choose, I’d opt to use Guava, keeping Apache Commons around for the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)