Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ext/java/org/jruby/ext/digest/RubyDigest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.util.ArraySupport;
import org.jruby.util.ByteList;
import org.jruby.util.TypeConverter;
import org.jruby.util.log.Logger;
import org.jruby.util.log.LoggerFactory;

Expand Down Expand Up @@ -302,7 +303,9 @@ public static IRubyObject op_equal(ThreadContext context, IRubyObject self, IRub
str2 = digest(context, oth, null).convertToString();
} else {
str1 = to_s(context, self).convertToString();
str2 = oth.convertToString();
IRubyObject converted = TypeConverter.checkStringType(context.runtime, oth);
if (converted.isNil()) return context.fals;
str2 = (RubyString) converted;
}
boolean ret = str1.bytesize(context).eql(str2.bytesize(context)) && (str1.eql(str2));
return ret ? context.tru : context.fals;
Expand Down