Skip to content
New issue

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

use isEmpty to check if string is empty #116

Open
wants to merge 1 commit into
base: 2.3-gae
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void printStackTrace(PrintWriter pw) {
synchronized (pw) {
String msg = this.getMessage();
pw.print("Encountered stop instruction");
if (msg != null && !msg.equals("")) {
if (msg != null && !msg.isEmpty()) {
pw.println("\nCause given: " + msg);
} else pw.println();
super.printStackTrace(pw);
Expand All @@ -54,7 +54,7 @@ public void printStackTrace(PrintStream ps) {
synchronized (ps) {
String msg = this.getMessage();
ps.print("Encountered stop instruction");
if (msg != null && !msg.equals("")) {
if (msg != null && !msg.isEmpty()) {
ps.println("\nCause given: " + msg);
} else ps.println();
super.printStackTrace(ps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public String getAsString() {
@Override
public String getNodeName() {
String result = node.getLocalName();
if (result == null || result.equals("")) {
if (result == null || result.isEmpty()) {
result = node.getNodeName();
}
return result;
Expand All @@ -52,7 +52,7 @@ public boolean isEmpty() {
@Override
String getQualifiedName() {
String nsURI = node.getNamespaceURI();
if (nsURI == null || nsURI.equals(""))
if (nsURI == null || nsURI.isEmpty())
return node.getNodeName();
Environment env = Environment.getCurrentEnvironment();
String defaultNS = env.getDefaultNS();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public String getAsString() throws TemplateModelException {
@Override
public String getNodeName() {
String result = node.getLocalName();
if (result == null || result.equals("")) {
if (result == null || result.isEmpty()) {
result = node.getNodeName();
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ public String getDefaultNS() {
* @return the NamespaceUri mapped to this prefix in this template. (Or null if there is none.)
*/
public String getNamespaceForPrefix(String prefix) {
if (prefix.equals("")) {
if (prefix.isEmpty()) {
return defaultNS == null ? "" : defaultNS;
}
return (String) prefixToNamespaceURILookup.get(prefix);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static Method getMethodByFunctionSignature(Class clazz, String signature)
String params = m1.group(4).trim();
Class [] paramTypes = null;

if ("".equals(params)) {
if (params.isEmpty()) {
paramTypes = new Class[0];
} else {
String [] paramsArray = StringUtil.split(params, ',');
Expand Down