Skip to content
Draft
Show file tree
Hide file tree
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
54 changes: 0 additions & 54 deletions core/src/main/java/org/jruby/RubyHash.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,60 +245,6 @@ protected RubyHash(Ruby runtime, RubyClass klass, boolean objectSpace, int unuse
assert this.getClass() != RubyHash.class;
}

// Delegated constructor, to be hidden and returned to normal super constructor once no longer in use
@Deprecated(since = "10.0.6.0", forRemoval = true)
public RubyHash(Ruby runtime, RubyClass klass) {
super(runtime, klass);
// ensure no subclasses call this constructor
assert getClass() == RubyHash.class;
setDelegate(this);
}

// Delegated constructor, to be hidden and returned to normal super constructor once no longer in use
@Deprecated(since = "10.0.3.0")
public RubyHash(Ruby runtime, RubyClass klass, boolean objectSpace) {
super(runtime, klass, objectSpace);
// ensure no subclasses call this constructor
assert getClass() == RubyHash.class;
this.setDelegate(new RubyHashLinkedBuckets(runtime, klass, objectSpace));
}

// Delegated constructor, to be hidden and returned to normal super constructor once no longer in use
@Deprecated(since = "10.0.6.0", forRemoval = true)
public RubyHash(Ruby runtime, int buckets) {
this(runtime, UNDEF, buckets);
}

@Deprecated(since = "10.0.6.0", forRemoval = true)
public RubyHash(Ruby runtime) {
super(runtime, runtime.getHash());
// ensure no subclasses call this constructor
assert getClass() == RubyHash.class;
this.setDelegate(RubyHashLinkedBuckets.newLBHash(runtime));
}

// Delegated constructor, to be hidden and returned to normal super constructor once no longer in use
@Deprecated(since = "10.0.6.0", forRemoval = true)
public RubyHash(Ruby runtime, IRubyObject defaultValue) {
super(runtime, runtime.getHash());
// ensure no subclasses call this constructor
assert getClass() == RubyHash.class;
this.setDelegate(RubyHashLinkedBuckets.newLBHash(runtime, defaultValue));
}

@Deprecated(since = "10.0.6.0", forRemoval = true)
public RubyHash(Ruby runtime, IRubyObject defaultValue, int buckets) {
super(runtime, runtime.getHash());
this.setDelegate(RubyHashLinkedBuckets.newLBHash(runtime, defaultValue, buckets));
}

// TODO should this be deprecated ? (to be efficient, internals should deal with RubyHash directly)
@Deprecated(since = "10.0.3.0", forRemoval = true)
public RubyHash(Ruby runtime, Map valueMap, IRubyObject defaultValue) {
super(runtime, runtime.getHash());
this.setDelegate(RubyHashLinkedBuckets.newHash(runtime, valueMap, defaultValue));
}

/* ============================
* Here are hash internals
* (This could be extracted to a separate class but it's not too large though)
Expand Down
6 changes: 1 addition & 5 deletions core/src/main/java/org/jruby/RubyHashLinkedBuckets.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,6 @@ protected RubyHashLinkedBuckets(Ruby runtime, RubyClass klass) {
allocFirst();
}

protected RubyHashLinkedBuckets(Ruby runtime, int buckets) {
this(runtime, UNDEF, buckets);
}

protected RubyHashLinkedBuckets(Ruby runtime) {
this(runtime, UNDEF);
}
Expand Down Expand Up @@ -234,7 +230,7 @@ private static void copyFrom(RubyHashLinkedBuckets self, RubyHash other, boolean
}

public static RubyHashLinkedBuckets newLBHash(Ruby runtime, int buckets) {
return new RubyHashLinkedBuckets(runtime, buckets);
return new RubyHashLinkedBuckets(runtime, UNDEF, buckets);
}

public static RubyHashLinkedBuckets newLBHash(Ruby runtime, int buckets, boolean objectSpace) {
Expand Down
Loading