Skip to content

Commit

Permalink
Bumped to commons-collections4 CTR
Browse files Browse the repository at this point in the history
  • Loading branch information
spmallette committed Dec 12, 2023
1 parent 442a3ac commit 95405bc
Show file tree
Hide file tree
Showing 17 changed files with 109 additions and 82 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
* Deprecated `withEmbedded()` and `withRemote()` options on `AnonymousTraversalSource`.
* Added `with()` on `AnonymousTraversalSource` to cover both embedded and remote creation options.
* Removed the deprecated `withGraph()` option from `AnonymousTraversalSource`.
* Bumped to `commons-collection4`.
== TinkerPop 3.7.0 (Gremfir Master of the Pan Flute)
Expand Down
6 changes: 4 additions & 2 deletions gremlin-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,15 @@ limitations under the License.
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
</dependency>
<!-- commons-configuration2 requires beanutils because we rely on file loaders -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,29 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal.traverser;

import org.apache.commons.collections.map.ReferenceMap;
import org.apache.commons.collections4.map.AbstractReferenceMap;
import org.apache.commons.collections4.map.ReferenceMap;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.LabelledCounter;


import java.util.Iterator;
import java.util.Map;
import java.util.Stack;

public class B_LP_NL_O_P_S_SE_SL_Traverser<T> extends B_LP_O_P_S_SE_SL_Traverser<T> {

protected Stack<LabelledCounter> nestedLoops;
protected ReferenceMap loopNames = null;
protected ReferenceMap<String,Object> loopNames = null;

protected B_LP_NL_O_P_S_SE_SL_Traverser() {
}

public B_LP_NL_O_P_S_SE_SL_Traverser(final T t, final Step<T, ?> step, final long initialBulk) {
super(t, step, initialBulk);
this.nestedLoops = new Stack<>();
this.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
this.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);
}

/////////////////
Expand Down Expand Up @@ -87,11 +90,12 @@ public <R> Admin<R> split(final R r, final Step<T, R> step) {
clone.nestedLoops.push((LabelledCounter) lc.clone());

if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
clone.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);

final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
final Iterator<Map.Entry<String,Object>> loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final ReferenceMap.Entry<String,Object> pair = loopNamesIterator.next();

final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
Expand All @@ -110,11 +114,12 @@ public Admin<T> split() {
clone.nestedLoops.push((LabelledCounter) lc.clone());

if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
clone.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);

final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
final Iterator<Map.Entry<String,Object>> loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final ReferenceMap.Entry<String,Object> pair = loopNamesIterator.next();

final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,29 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal.traverser;

import org.apache.commons.collections.map.ReferenceMap;
import org.apache.commons.collections4.map.ReferenceMap;
import org.apache.commons.collections4.map.AbstractReferenceMap;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.LabelledCounter;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.Stack;

public class B_LP_NL_O_S_SE_SL_Traverser<T> extends B_LP_O_S_SE_SL_Traverser<T> {

protected Stack<LabelledCounter> nestedLoops;
protected ReferenceMap loopNames = null;
protected ReferenceMap<String,Object> loopNames = null;

protected B_LP_NL_O_S_SE_SL_Traverser() {
}

public B_LP_NL_O_S_SE_SL_Traverser(final T t, final Step<T, ?> step, final long initialBulk) {
super(t, step, initialBulk);
this.nestedLoops = new Stack<>();
this.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
this.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);
}

/////////////////
Expand Down Expand Up @@ -91,11 +94,12 @@ public <R> Admin<R> split(final R r, final Step<T, R> step) {
clone.nestedLoops.push((LabelledCounter) lc.clone());

if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
clone.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);

final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
final Iterator<Map.Entry<String,Object>> loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final ReferenceMap.Entry<String,Object> pair = loopNamesIterator.next();

final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
Expand All @@ -114,11 +118,12 @@ public Admin<T> split() {
clone.nestedLoops.push((LabelledCounter) lc.clone());

if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
clone.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);

final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
final Iterator<Map.Entry<String,Object>> loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final ReferenceMap.Entry<String,Object> pair = loopNamesIterator.next();

final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,28 @@
*/
package org.apache.tinkerpop.gremlin.process.traversal.traverser;

import org.apache.commons.collections.map.ReferenceMap;
import org.apache.commons.collections4.map.AbstractReferenceMap;
import org.apache.commons.collections4.map.ReferenceMap;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.LabelledCounter;

import java.util.Iterator;
import java.util.Map;
import java.util.Stack;

public class B_NL_O_S_SE_SL_Traverser<T> extends B_O_S_SE_SL_Traverser<T> {

protected Stack<LabelledCounter> nestedLoops;
protected ReferenceMap loopNames = null;
protected ReferenceMap<String,Object> loopNames = null;

protected B_NL_O_S_SE_SL_Traverser() {
}

public B_NL_O_S_SE_SL_Traverser(final T t, final Step<T, ?> step, final long initialBulk) {
super(t, step, initialBulk);
this.nestedLoops = new Stack<>();
this.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
this.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);
}

/////////////////
Expand Down Expand Up @@ -87,11 +90,12 @@ public <R> Admin<R> split(final R r, final Step<T, R> step) {
clone.nestedLoops.push((LabelledCounter) lc.clone());

if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
clone.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);

final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
final Iterator<Map.Entry<String,Object>> loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final ReferenceMap.Entry<String,Object> pair = loopNamesIterator.next();

final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
Expand All @@ -111,11 +115,12 @@ public Admin<T> split() {
clone.nestedLoops.push((LabelledCounter) lc.clone());

if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
clone.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);

final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
final Iterator<Map.Entry<String,Object>> loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final ReferenceMap.Entry<String,Object> pair = loopNamesIterator.next();

final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

package org.apache.tinkerpop.gremlin.process.traversal.traverser;

import org.apache.commons.collections.map.ReferenceMap;
import org.apache.commons.collections4.map.AbstractReferenceMap;
import org.apache.commons.collections4.map.ReferenceMap;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.LabelledCounter;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.Stack;

Expand All @@ -38,7 +40,8 @@ protected LP_NL_O_OB_P_S_SE_SL_Traverser() {
public LP_NL_O_OB_P_S_SE_SL_Traverser(final T t, final Step<T, ?> step) {
super(t, step);
this.nestedLoops = new Stack<>();
this.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
this.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);
}

/////////////////
Expand Down Expand Up @@ -88,11 +91,12 @@ public <R> Admin<R> split(final R r, final Step<T, R> step) {
clone.nestedLoops.push((LabelledCounter) lc.clone());

if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
clone.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);

final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
final Iterator<Map.Entry<String,Object>> loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final ReferenceMap.Entry<String,Object> pair = loopNamesIterator.next();

final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
Expand All @@ -111,11 +115,12 @@ public Admin<T> split() {
clone.nestedLoops.push((LabelledCounter) lc.clone());

if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
clone.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);

final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
final Iterator<Map.Entry<String,Object>> loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final ReferenceMap.Entry<String,Object> pair = loopNamesIterator.next();

final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,29 @@

package org.apache.tinkerpop.gremlin.process.traversal.traverser;

import org.apache.commons.collections.map.ReferenceMap;
import org.apache.commons.collections4.map.AbstractReferenceMap;
import org.apache.commons.collections4.map.ReferenceMap;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.LabelledCounter;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.Stack;

public class LP_NL_O_OB_S_SE_SL_Traverser<T> extends LP_O_OB_S_SE_SL_Traverser<T> {

protected Stack<LabelledCounter> nestedLoops;
protected ReferenceMap loopNames = null;
protected ReferenceMap<String,Object> loopNames = null;

protected LP_NL_O_OB_S_SE_SL_Traverser() {
}

public LP_NL_O_OB_S_SE_SL_Traverser(final T t, final Step<T, ?> step) {
super(t, step);
this.nestedLoops = new Stack<>();
this.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
this.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);
}

/////////////////
Expand Down Expand Up @@ -93,11 +96,12 @@ public <R> Admin<R> split(final R r, final Step<T, R> step) {
clone.nestedLoops.push((LabelledCounter) lc.clone());

if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
clone.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);

final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
final Iterator<Map.Entry<String,Object>> loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final ReferenceMap.Entry<String,Object> pair = loopNamesIterator.next();

final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
Expand All @@ -116,11 +120,12 @@ public Admin<T> split() {
clone.nestedLoops.push((LabelledCounter) lc.clone());

if (this.loopNames != null) {
clone.loopNames = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
clone.loopNames = new ReferenceMap<>(AbstractReferenceMap.ReferenceStrength.HARD,
AbstractReferenceMap.ReferenceStrength.WEAK);

final Iterator loopNamesIterator = this.loopNames.entrySet().iterator();
final Iterator<Map.Entry<String,Object>> loopNamesIterator = this.loopNames.entrySet().iterator();
while (loopNamesIterator.hasNext()) {
final ReferenceMap.Entry pair = (ReferenceMap.Entry) loopNamesIterator.next();
final ReferenceMap.Entry<String,Object> pair = loopNamesIterator.next();

final int idx = this.nestedLoops.indexOf(pair.getValue());
if (idx != -1)
Expand Down
Loading

0 comments on commit 95405bc

Please sign in to comment.