openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r546567 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
Date Tue, 12 Jun 2007 16:43:10 GMT
Author: ppoddar
Date: Tue Jun 12 09:43:10 2007
New Revision: 546567

URL: http://svn.apache.org/viewvc?view=rev&rev=546567
Log:
Replace usage of String.contains() by JDK1.4 compliant method 


Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java?view=diff&rev=546567&r1=546566&r2=546567
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
Tue Jun 12 09:43:10 2007
@@ -393,8 +393,8 @@
                 factory.setConfiguration(_conf);
                 _schema = factory;
             } else if (_readSchema 
-                || _schemaActions.contains(SchemaTool.ACTION_RETAIN)
-                || _schemaActions.contains(SchemaTool.ACTION_REFRESH)) {
+                || contains(_schemaActions,SchemaTool.ACTION_RETAIN)
+                || contains(_schemaActions,SchemaTool.ACTION_REFRESH)) {
                 _schema = (SchemaGroup) newSchemaTool(null).getDBSchemaGroup().
                     clone();
             } else {
@@ -726,8 +726,8 @@
         MappingRepository repos = getRepository();
         repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos));
         if (getMapping(repos, cls, true) != null)
-            _flushSchema = !_schemaActions.contains(SCHEMA_ACTION_NONE)
-                && !_schemaActions.contains(SchemaTool.ACTION_ADD);
+            _flushSchema = !contains(_schemaActions,SCHEMA_ACTION_NONE)
+                && !contains(_schemaActions,SchemaTool.ACTION_ADD);
     }
 
     /**
@@ -771,7 +771,7 @@
         if (_dropCls == null)
             _dropCls = new HashSet();
         _dropCls.add(cls);
-        if (!_schemaActions.contains(SchemaTool.ACTION_DROP))
+        if (!contains(_schemaActions,SchemaTool.ACTION_DROP))
             return;
 
         MappingRepository repos = getRepository();
@@ -1080,6 +1080,10 @@
         } catch (Throwable t) {
             throw new InternalException(_loc.get("importexport-instantiate"),t);
         }
+    }
+    
+    private static boolean contains(String list, String key) {
+    	return (list == null) ? false : list.indexOf(key) != -1;
     }
 
     /**



Mime
View raw message