@SuppressWarnings("unchecked")
protected Map<IRubyObject, Savepoint> getSavepoints(final ThreadContext context) {
if ( hasInstanceVariable("@savepoints") ) {
IRubyObject savepoints = getInstanceVariable("@savepoints");
return (Map<IRubyObject, Savepoint>) savepoints.toJava(Map.class);
}
else { // not using a RubyHash to preserve order on Ruby 1.8 as well :
Map<IRubyObject, Savepoint> savepoints = new LinkedHashMap<IRubyObject, Savepoint>(4);
setInstanceVariable("@savepoints", convertJavaToRuby(savepoints));
return savepoints;