Title: [452] trunk/activerecord-jdbc: - Fix compile errors to bring up to synch with new RubyHash in JRuby trunk
Revision
452
Author
nicksieger
Date
2007-04-14 22:19:27 -0400 (Sat, 14 Apr 2007)

Log Message

- Fix compile errors to bring up to synch with new RubyHash in JRuby trunk

Modified Paths

Diff

Modified: trunk/activerecord-jdbc/pom.xml (451 => 452)


--- trunk/activerecord-jdbc/pom.xml	2007-04-13 02:35:21 UTC (rev 451)
+++ trunk/activerecord-jdbc/pom.xml	2007-04-15 02:19:27 UTC (rev 452)
@@ -10,13 +10,22 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.jruby.testsuites</groupId>
   <artifactId>activerecord-jdbc</artifactId>
-  <packaging>pom</packaging>
+  <packaging>jar</packaging>
   <version>0.9.9-SNAPSHOT</version>
   <name>JRuby ActiveRecord-JDBC testsuite</name>
   <description>Test ActiveRecord-JDBC</description>
 
+  <dependencies>
+    <dependency>
+      <groupId>org.jruby</groupId>
+      <artifactId>jruby</artifactId>
+      <version>0.9.9-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+
   <build>
     <directory>${basedir}/pkg</directory>
+    <sourceDirectory>${basedir}/src/java</sourceDirectory>
     <outputDirectory>${basedir}/pkg/classes</outputDirectory>
     <testOutputDirectory>${basedir}/pkg/test-classes</testOutputDirectory>
     <plugins>

Modified: trunk/activerecord-jdbc/src/java/JdbcAdapterInternalService.java (451 => 452)


--- trunk/activerecord-jdbc/src/java/JdbcAdapterInternalService.java	2007-04-13 02:35:21 UTC (rev 451)
+++ trunk/activerecord-jdbc/src/java/JdbcAdapterInternalService.java	2007-04-15 02:19:27 UTC (rev 452)
@@ -134,15 +134,14 @@
     public static IRubyObject native_database_types(IRubyObject recv) {
         RubyHash tps = (RubyHash)recv.getInstanceVariable("@tps");
         Map val = new HashMap();
-        Map tpsmap = tps.getValueMap();
         Ruby runtime = recv.getRuntime();
         IRubyObject nameSym = runtime.newSymbol("name");
-        for(Iterator iter = tpsmap.entrySet().iterator();iter.hasNext();) {
+        for(Iterator iter = tps.directEntrySet().iterator();iter.hasNext();) {
             Map.Entry me = (Map.Entry)iter.next();
             IRubyObject v = (IRubyObject)me.getValue();
             if(v instanceof RubyHash) {
                 RubyHash v2 = (RubyHash)(v.dup());
-                v2.put(nameSym, ((IRubyObject)(v2.getValueMap().get(nameSym))).dup());
+                v2.put(nameSym, ((IRubyObject)(v2.fastARef(nameSym))).dup());
                 val.put(me.getKey(), v2);
             } else {
                 val.put(me.getKey(), ((IRubyObject)v).dup());
@@ -238,7 +237,7 @@
         Ruby runtime = recv.getRuntime();
         ThreadContext ctx = runtime.getCurrentContext();
 
-        Map tps = ((RubyHash)(recv.callMethod(ctx, "adapter").callMethod(ctx,"native_database_types"))).getValueMap();
+        RubyHash tps = ((RubyHash)(recv.callMethod(ctx, "adapter").callMethod(ctx,"native_database_types")));
 
         IRubyObject jdbcCol = ((RubyModule)(runtime.getModule("ActiveRecord").getConstant("ConnectionAdapters"))).getConstant("JdbcColumn");
 
@@ -279,7 +278,7 @@
                                                                             runtime.newBoolean(!rs.getString(18).equals("NO"))});
             columns.add(c);
 
-            IRubyObject tp = (IRubyObject)tps.get(c.callMethod(ctx,"type"));
+            IRubyObject tp = (IRubyObject)tps.fastARef(c.callMethod(ctx,"type"));
             if(tp != null && !tp.isNil() && tp.callMethod(ctx,"[]",runtime.newSymbol("limit")).isNil()) {
                 c.callMethod(ctx,"limit=", runtime.getNil());
                 if(!c.callMethod(ctx,"type").equals(runtime.newSymbol("decimal"))) {
_______________________________________________
Jruby-extras-devel mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to