本文整理了Java中org.jruby.Ruby.newFrozenError
方法的一些代码示例,展示了Ruby.newFrozenError
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.newFrozenError
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:newFrozenError
暂无
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
private void raiseFrozenError() throws RaiseException {
if (this instanceof RubyModule) {
throw getRuntime().newFrozenError("class/module ");
} else {
throw getRuntime().newFrozenError("");
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
protected final void ensureClassVariablesSettable() {
Ruby runtime = getRuntime();
if (!isFrozen()) {
return;
}
if (this instanceof RubyModule) {
throw runtime.newFrozenError(ERR_FROZEN_CONST_TYPE);
} else {
throw runtime.newFrozenError("");
}
}
代码示例来源:origin: org.jruby/jruby-complete
private void raiseFrozenError() throws RaiseException {
if (this instanceof RubyModule) {
throw getRuntime().newFrozenError("class/module ");
} else {
throw getRuntime().newFrozenError(getMetaClass());
}
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_frozen_class_p
*
* Helper to test whether this object is frozen, and if it is will
* throw an exception based on the message.
*/
protected final void testFrozen() {
if (isFrozen()) {
throw getRuntime().newFrozenError("object");
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/** rb_frozen_class_p
*
* Helper to test whether this object is frozen, and if it is will
* throw an exception based on the message.
*/
protected final void testFrozen() {
if (isFrozen()) {
throw getRuntime().newFrozenError("object");
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_frozen_class_p
*
* Helper to test whether this object is frozen, and if it is will
* throw an exception based on the message.
*/
protected final void testFrozen() {
if (isFrozen()) {
throw getRuntime().newFrozenError("object");
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_frozen_class_p
*
* Helper to test whether this object is frozen, and if it is will
* throw an exception based on the message.
*/
protected final void testFrozen(String message) {
if (isFrozen()) {
throw getRuntime().newFrozenError(message);
}
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_frozen_class_p
*
* Helper to test whether this object is frozen, and if it is will
* throw an exception based on the message.
*/
protected final void testFrozen(String message) {
if (isFrozen()) {
throw getRuntime().newFrozenError(message);
}
}
代码示例来源:origin: org.jruby/jruby-core
/** rb_frozen_class_p
*
* Helper to test whether this object is frozen, and if it is will
* throw an exception based on the message.
*/
protected final void testFrozen(String message) {
if (isFrozen()) {
throw getRuntime().newFrozenError(message);
}
}
代码示例来源:origin: org.jruby/jruby-core
@Override
public final void checkFrozen() {
if ( isFrozen() ) {
throw getRuntime().newFrozenError(isClass() ? "class" : "module");
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/** rb_ary_modify_check
*
*/
private final void modifyCheck() {
if ((flags & TMPLOCK_OR_FROZEN_ARR_F) != 0) {
if ((flags & FROZEN_F) != 0) throw getRuntime().newFrozenError("array");
if ((flags & TMPLOCK_ARR_F) != 0) throw getRuntime().newTypeError("can't modify array during iteration");
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/** rb_ary_modify_check
*
*/
private final void modifyCheck() {
if ((flags & TMPLOCK_OR_FROZEN_ARR_F) != 0) {
if ((flags & FROZEN_F) != 0) throw getRuntime().newFrozenError("array");
if ((flags & TMPLOCK_ARR_F) != 0) throw getRuntime().newTypeError("can't modify array during iteration");
}
}
代码示例来源:origin: org.jruby/jruby-complete
@Override
public final void checkFrozen() {
if ( isFrozen() ) {
throw getRuntime().newFrozenError(isClass() ? "class" : "module");
}
}
代码示例来源:origin: org.jruby/jruby-complete
private RubyTime adjustTimeZone(Ruby runtime, final DateTimeZone zone) {
if (zone.equals(dt.getZone())) return this;
if (isFrozen()) {
throw runtime.newFrozenError("Time", true);
}
dt = dt.withZone(zone);
return this;
}
代码示例来源:origin: org.jruby/jruby-complete
/** rb_ary_modify_check
*
*/
protected final void modifyCheck() {
if ((flags & TMPLOCK_OR_FROZEN_ARR_F) != 0) {
if ((flags & FROZEN_F) != 0) throw getRuntime().newFrozenError(this.getMetaClass());
if ((flags & TMPLOCK_ARR_F) != 0) throw getRuntime().newTypeError("can't modify array during iteration");
}
}
代码示例来源:origin: org.jruby/jruby-core
private RubyTime adjustTimeZone(Ruby runtime, final DateTimeZone zone) {
if (zone.equals(dt.getZone())) return this;
if (isFrozen()) {
throw runtime.newFrozenError("Time", true);
}
dt = dt.withZone(zone);
return this;
}
代码示例来源:origin: org.jruby/jruby-core
/** rb_ary_modify_check
*
*/
protected final void modifyCheck() {
if ((flags & TMPLOCK_OR_FROZEN_ARR_F) != 0) {
if ((flags & FROZEN_F) != 0) throw getRuntime().newFrozenError(this.getMetaClass());
if ((flags & TMPLOCK_ARR_F) != 0) throw getRuntime().newTypeError("can't modify array during iteration");
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public static RubyClass performSingletonMethodChecks(Ruby runtime, IRubyObject receiver, String name) throws RaiseException {
if (receiver instanceof RubyFixnum || receiver instanceof RubySymbol) {
throw runtime.newTypeError("can't define singleton method \"" + name + "\" for " + receiver.getMetaClass().getBaseName());
}
if (receiver.isFrozen()) {
throw runtime.newFrozenError("object");
}
RubyClass rubyClass = receiver.getSingletonClass();
return rubyClass;
}
代码示例来源:origin: org.jruby/jruby-complete
public static RubyClass performSingletonMethodChecks(Ruby runtime, IRubyObject receiver, String name) throws RaiseException {
if (receiver instanceof RubyFixnum || receiver instanceof RubySymbol) {
throw runtime.newTypeError(str(runtime, "can't define singleton method \"", ids(runtime, name), "\" for ", types(runtime, receiver.getMetaClass())));
}
if (receiver.isFrozen()) {
throw runtime.newFrozenError("object");
}
RubyClass rubyClass = receiver.getSingletonClass();
return rubyClass;
}
代码示例来源:origin: org.jruby/jruby-core
public static RubyClass performSingletonMethodChecks(Ruby runtime, IRubyObject receiver, String name) throws RaiseException {
if (receiver instanceof RubyFixnum || receiver instanceof RubySymbol) {
throw runtime.newTypeError(str(runtime, "can't define singleton method \"", ids(runtime, name), "\" for ", types(runtime, receiver.getMetaClass())));
}
if (receiver.isFrozen()) {
throw runtime.newFrozenError("object");
}
RubyClass rubyClass = receiver.getSingletonClass();
return rubyClass;
}
内容来源于网络,如有侵权,请联系作者删除!