@SuppressWarnings("unchecked") private MapJavaProxy dupImpl(final String method) { final Map map = getMapObject(); try { Map newMap = map.getClass().newInstance(); newMap.putAll(map); MapJavaProxy proxy = new MapJavaProxy(getRuntime(), metaClass); proxy.setObject(newMap); return proxy; } catch (InstantiationException|IllegalAccessException ex) { final RaiseException e = getRuntime().newNotImplementedError("can't "+ method +" Map of type " + getObject().getClass().getName()); e.initCause(ex); throw e; } }
@SuppressWarnings("unchecked") private MapJavaProxy dupImpl(final String method) { final Map map = getMapObject(); try { Map newMap = map.getClass().newInstance(); newMap.putAll(map); MapJavaProxy proxy = new MapJavaProxy(getRuntime(), metaClass); proxy.setObject(newMap); return proxy; } catch (InstantiationException|IllegalAccessException ex) { final RaiseException e = getRuntime().newNotImplementedError("can't "+ method +" Map of type " + getObject().getClass().getName()); e.initCause(ex); throw e; } }
@Override public IRubyObject rbClone() { try { MapJavaProxy proxy = new MapJavaProxy(getRuntime(), metaClass); Map newMap = (Map)getObject().getClass().newInstance(); newMap.putAll((Map)getObject()); proxy.setObject(newMap); return proxy; } catch (InstantiationException ex) { throw getRuntime().newNotImplementedError("can't clone Map of type " + getObject().getClass().getName()); } catch (IllegalAccessException ex) { throw getRuntime().newNotImplementedError("can't clone Map of type " + getObject().getClass().getName()); } }
@Override public IRubyObject dup() { try { MapJavaProxy proxy = new MapJavaProxy(getRuntime(), metaClass); Map newMap = (Map)getObject().getClass().newInstance(); newMap.putAll((Map)getObject()); proxy.setObject(newMap); return proxy; } catch (InstantiationException ex) { throw getRuntime().newNotImplementedError("can't dup Map of type " + getObject().getClass().getName()); } catch (IllegalAccessException ex) { throw getRuntime().newNotImplementedError("can't dup Map of type " + getObject().getClass().getName()); } }
@Override public IRubyObject dup() { try { MapJavaProxy proxy = new MapJavaProxy(getRuntime(), metaClass); Map newMap = (Map)getObject().getClass().newInstance(); newMap.putAll((Map)getObject()); proxy.setObject(newMap); return proxy; } catch (InstantiationException ex) { throw getRuntime().newNotImplementedError("can't dup Map of type " + getObject().getClass().getName()); } catch (IllegalAccessException ex) { throw getRuntime().newNotImplementedError("can't dup Map of type " + getObject().getClass().getName()); } }
@Override public IRubyObject rbClone() { try { MapJavaProxy proxy = new MapJavaProxy(getRuntime(), metaClass); Map newMap = (Map)getObject().getClass().newInstance(); newMap.putAll((Map)getObject()); proxy.setObject(newMap); return proxy; } catch (InstantiationException ex) { throw getRuntime().newNotImplementedError("can't clone Map of type " + getObject().getClass().getName()); } catch (IllegalAccessException ex) { throw getRuntime().newNotImplementedError("can't clone Map of type " + getObject().getClass().getName()); } }