chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1367759 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
Date Tue, 31 Jul 2012 20:30:26 GMT
Author: jens
Date: Tue Jul 31 20:30:25 2012
New Revision: 1367759

URL: http://svn.apache.org/viewvc?rev=1367759&view=rev
Log:
InMemrory: avoid NPE in query if types do not match

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java?rev=1367759&r1=1367758&r2=1367759&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/query/InMemoryQueryProcessor.java
Tue Jul 31 20:30:25 2012
@@ -473,11 +473,15 @@ public class InMemoryQueryProcessor {
 
             String propVal = (String) PropertyUtil.getProperty(so, colRef.getPropertyId(),
pd);
             
-            String pattern = translatePattern((String) rVal); // SQL to Java
-                                                              // regex
-                                                              // syntax
-            Pattern p = Pattern.compile(pattern);
-            return p.matcher(propVal).matches();
+            if (null == propVal) {
+            	return false;
+            } else {
+            	String pattern = translatePattern((String) rVal); // SQL to Java
+            	// regex
+            	// syntax
+            	Pattern p = Pattern.compile(pattern);
+            	return p.matcher(propVal).matches();
+            }
         }
 
         @Override



Mime
View raw message