svn commit r16153 - trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

svn commit r16153 - trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino

svn-9
Author: keith
Date: Fri Apr 25 01:54:49 2008
New Revision: 16153

Log:

Avoiding potential NPE


Modified:
   trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java

Modified: trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java
==============================================================================
--- trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java (original)
+++ trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java Fri Apr 25 01:54:49 2008
@@ -55,7 +55,7 @@
         while (iterator.hasNext()) {
             OMElement element = (OMElement) iterator.next();
             final String className = element.getText();
-            if ((className != null) & (!className.equals(""))) {
+            if ((className != null) & (!"".equals(className))) {
                 try {
                     ScriptableObject.defineClass(cx, loadClass(className));
                 } catch (PrivilegedActionException e) {
@@ -119,8 +119,8 @@
             OMElement element = (OMElement) iterator.next();
             String objectName = element.getText();
             String hostObject = element.getAttributeValue(new QName("hostObject"));
-            if ((objectName != null) & (!objectName.equals("")) & (hostObject != null)
-                    & (!hostObject.equals(""))) {
+            if ((objectName != null) & (!"".equals(objectName)) & (hostObject != null)
+                    & (!"".equals(hostObject))) {
                 Scriptable entryHostObject = engine.getCx().newObject(engine, hostObject,
                                                                       new Object[0]);
                 engine.defineProperty(objectName, entryHostObject, ScriptableObject.READONLY);

_______________________________________________
Wsf-javascript-dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/wsf-javascript-dev
Loading...