modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 49a48ea47dde77506b48bb1c699dd6aab0ab8a20 Author: Jirka Kremser jkremser@redhat.com Date: Fri Dec 14 14:50:57 2012 +0100
[BZ 886287 - NullPointerException when another exception should have been thrown] quick fix, lazy evaluation of Java should ensure the prevention of throwing NPE
diff --git a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java index 6521d2e..006e1e4 100644 --- a/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java +++ b/modules/common/ant-bundle/src/main/java/org/rhq/bundle/ant/type/SystemServiceType.java @@ -87,14 +87,14 @@ public class SystemServiceType extends AbstractBundleType { }
public void init() throws BuildException { - if (!OS_NAME.equals("Linux") || !REDHAT_RELEASE_FILE.exists()) { + if (!"Linux".equals(OS_NAME) || !REDHAT_RELEASE_FILE.exists()) { throw new BuildException("The system-service element is only supported on Red Hat Linux systems."); }
if (!this.scriptFile.exists() || this.scriptFile.isDirectory()) { throw new BuildException("The 'scriptFile' attribute must be set to the path of an existing regular file."); } - if (this.configFile != null && !this.configFile.exists() || this.configFile.isDirectory()) { + if (this.configFile != null && (!this.configFile.exists() || this.configFile.isDirectory())) { throw new BuildException("The 'configFile' attribute must be set to the path of an existing regular file."); } }
rhq-commits@lists.fedorahosted.org