Fix improper string comparisons

This commit is contained in:
Sam Harwell
2013-08-23 07:40:06 -05:00
parent eb15f276f5
commit 3e3e8dca93
2 changed files with 6 additions and 6 deletions

View File

@@ -425,7 +425,7 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo {
String warBasename;
String webhelpOutdir = targetFile.getName().substring(0, targetFile.getName().lastIndexOf('.'));
if(null != webhelpDirname && webhelpDirname != ""){
if(null != webhelpDirname && !webhelpDirname.isEmpty()){
warBasename = webhelpDirname;
} else {
warBasename = webhelpOutdir;
@@ -586,7 +586,7 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo {
String warBasename;
String webhelpOutdir = result.getName().substring(0, result.getName().lastIndexOf('.'));
if(null != webhelpDirname && webhelpDirname != ""){
if(null != webhelpDirname && !webhelpDirname.isEmpty()){
warBasename = webhelpDirname;
} else {
warBasename = webhelpOutdir;
@@ -617,7 +617,7 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo {
String warSuffix = properties.getProperty("warsuffix","");
String warSuffixForWar = warSuffix.equals("-external") ? "" : warSuffix;
if(null != webhelpWar && webhelpWar != "0"){
if(null != webhelpWar && !"0".equals(webhelpWar)){
//Zip up the war from here.
File sourceDir = new File(result.getParentFile().getParentFile(), webhelpOutdir);
File zipFile = new File(result.getParentFile().getParentFile(), properties.getProperty("warprefix","") + warBasename + warSuffixForWar + ".war");
@@ -837,7 +837,7 @@ public abstract class WebHelpMojo extends AbstractWebhelpMojo {
}
}
if (null != webhelpDirname && webhelpDirname != "" ) {
if (null != webhelpDirname && !webhelpDirname.isEmpty() ) {
map.put("targetExtQueryFile", new File(getTargetDirectory(), webhelpDirname + "/content/ext_query.xml"));
map.put("base.dir", new File(getTargetDirectory(), webhelpDirname));

View File

@@ -201,7 +201,7 @@ public class PDFBuilder {
//final String inputFilename = sourceFilePath;
// targetFilename is inputFilename - ".xml" + targetFile extension
String baseTargetFile;
if(null != pdfFilenameBase && pdfFilenameBase != ""){
if(null != pdfFilenameBase && !pdfFilenameBase.isEmpty()){
baseTargetFile = pdfFilenameBase;
} else {
baseTargetFile = inputFilename.substring(0, inputFilename.length() - 4);
@@ -344,7 +344,7 @@ public class PDFBuilder {
transformer.setParameter("autoPdfGlossaryInfix","/..");
transformer.setParameter("branding", branding);
if(branding=="openstack") {
if("openstack".equals(branding)) {
transformer.setParameter("builtForOpenStack", "1");
} else {
transformer.setParameter("builtForOpenStack", "0");