Discussion:
Help with migrating one of OpenJPA classes to commons-collections4
(too old to reply)
Maxim Solodovnik
2018-09-01 08:45:47 UTC
Permalink
Hello,

I'm trying to migrate code of Apache OpenJPA from commons-collections
to commons-collections4

The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112

code of commons-collections4 is more restrictive could you please
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org
Maxim Solodovnik
2018-09-02 15:05:29 UTC
Permalink
Correct prefix is added to subject
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from commons-collections
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
code of commons-collections4 is more restrictive could you please
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org
Julio Oliveira
2018-09-03 13:02:36 UTC
Permalink
What is realy your problem??..
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from commons-collections
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
code of commons-collections4 is more restrictive could you please
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Maxim Solodovnik
2018-09-03 13:08:44 UTC
Permalink
Thanks a lot for the answer,

OpenJPA ReferenceHashMap overrides purge method to be able to call
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive copy/paste or reflection ...

Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this task will be trivial :)

https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138

On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from commons-collections
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
code of commons-collections4 is more restrictive could you please
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org
Maxim Solodovnik
2018-09-05 16:12:33 UTC
Permalink
Would it be possible to modify the code of AbstractReferenceMap.java as
follows?


diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
@@ -400,13 +400,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>) entry).purge(ref)) {
+ ReferenceEntry<K, V> refEntry = (ReferenceEntry<K, V>) entry;
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
throw new Error();
}

+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
* @param ref the reference to purge
* @return true or false
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType != ReferenceStrength.HARD && key ==
ref;
r = r || parent.valueType != ReferenceStrength.HARD && value
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength type) {
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value type.
+ * @param type the type to check against.
+ * @return true if valueType has the specified type
+ */
+ protected boolean isValueType(final ReferenceStrength type) {
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be able to call
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive copy/paste or reflection ...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this task will be trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from commons-collections
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive could you please
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
Gary Gregory
2018-09-05 20:16:54 UTC
Permalink
Hi,

Your best shot would be to submit a PR on GitHub which includes a unit test
that exercises the new code.

https://github.com/apache/commons-collections

Thank you,
Gary
Post by Maxim Solodovnik
Would it be possible to modify the code of AbstractReferenceMap.java as
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
@@ -400,13 +400,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>) entry).purge(ref)) {
+ ReferenceEntry<K, V> refEntry = (ReferenceEntry<K, V>) entry;
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType != ReferenceStrength.HARD && key ==
ref;
r = r || parent.valueType != ReferenceStrength.HARD && value
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength type) {
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value type.
+ */
+ protected boolean isValueType(final ReferenceStrength type) {
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be able to call
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive copy/paste or
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this task will be trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from commons-collections
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive could you please
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
Maxim Solodovnik
2018-09-19 07:24:21 UTC
Permalink
Done: https://github.com/apache/commons-collections/pull/51
Could you please take a look at this PR?
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which includes a unit test
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
Post by Maxim Solodovnik
Would it be possible to modify the code of AbstractReferenceMap.java as
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
@@ -400,13 +400,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>) entry).purge(ref)) {
+ ReferenceEntry<K, V> refEntry = (ReferenceEntry<K, V>) entry;
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType != ReferenceStrength.HARD && key ==
ref;
r = r || parent.valueType != ReferenceStrength.HARD && value
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength type) {
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value type.
+ */
+ protected boolean isValueType(final ReferenceStrength type) {
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be able to call
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive copy/paste or
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this task will be trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from commons-collections
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive could you please
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org
Gary Gregory
2018-09-19 15:10:45 UTC
Permalink
Maxim,
Thank you for your patch.
I created https://issues.apache.org/jira/browse/COLLECTIONS-696 and
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.

Thank you,
Gary
Post by Maxim Solodovnik
Done: https://github.com/apache/commons-collections/pull/51
Could you please take a look at this PR?
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which includes a unit
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
Post by Maxim Solodovnik
Would it be possible to modify the code of AbstractReferenceMap.java as
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>) entry).purge(ref)) {
+ ReferenceEntry<K, V> refEntry = (ReferenceEntry<K, V>)
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType != ReferenceStrength.HARD &&
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType != ReferenceStrength.HARD &&
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength type) {
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value type.
+ */
+ protected boolean isValueType(final ReferenceStrength type) {
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be able to call
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive copy/paste or
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this task will be
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive could you please
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Maxim Solodovnik
2018-09-20 05:47:38 UTC
Permalink
Hello Gary,

I have tested changes, everything works as expected
Thanks a lot!

I have closed PR, but have no rights to close JIRA :(

Do you have any plans for 4.3 release?
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created https://issues.apache.org/jira/browse/COLLECTIONS-696 and
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
Post by Maxim Solodovnik
Done: https://github.com/apache/commons-collections/pull/51
Could you please take a look at this PR?
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which includes a unit
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
Post by Maxim Solodovnik
Would it be possible to modify the code of AbstractReferenceMap.java as
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>) entry).purge(ref)) {
+ ReferenceEntry<K, V> refEntry = (ReferenceEntry<K, V>)
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType != ReferenceStrength.HARD &&
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType != ReferenceStrength.HARD &&
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength type) {
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value type.
+ */
+ protected boolean isValueType(final ReferenceStrength type) {
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be able to call
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive copy/paste or
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this task will be
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive could you please
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org
Maxim Solodovnik
2018-09-20 10:58:22 UTC
Permalink
One more question: it seems there is no 4.3-SNAPSHOT build available
Could you please create it?
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created https://issues.apache.org/jira/browse/COLLECTIONS-696 and
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
Post by Maxim Solodovnik
Done: https://github.com/apache/commons-collections/pull/51
Could you please take a look at this PR?
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which includes a unit
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
Post by Maxim Solodovnik
Would it be possible to modify the code of AbstractReferenceMap.java as
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>) entry).purge(ref)) {
+ ReferenceEntry<K, V> refEntry = (ReferenceEntry<K, V>)
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType != ReferenceStrength.HARD &&
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType != ReferenceStrength.HARD &&
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class AbstractReferenceMap<K, V>
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength type) {
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value type.
+ */
+ protected boolean isValueType(final ReferenceStrength type) {
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be able to call
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive copy/paste or
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this task will be
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive could you please
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org
Maxim Solodovnik
2018-09-24 03:32:11 UTC
Permalink
Hello,

could you please create 4.3-SNAPSHOT build?

And if you have any estimates on 4.3 release, could you please share it? :)
Post by Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT build available
Could you please create it?
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created https://issues.apache.org/jira/browse/COLLECTIONS-696 and
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
Post by Maxim Solodovnik
Done: https://github.com/apache/commons-collections/pull/51
Could you please take a look at this PR?
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which includes a
unit
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Would it be possible to modify the code of
AbstractReferenceMap.java as
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>) entry).purge(ref)) {
+ ReferenceEntry<K, V> refEntry = (ReferenceEntry<K,
V>)
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType !=
ReferenceStrength.HARD &&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType != ReferenceStrength.HARD
&&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength type) {
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value type.
+ */
+ protected boolean isValueType(final ReferenceStrength type)
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be able to
call
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive copy/paste or
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this task
will be
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive could you
please
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
Benedikt Ritter
2018-09-25 13:36:14 UTC
Permalink
Hello Maxim,
Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
could you please create 4.3-SNAPSHOT build?
I'll check whether I have permission to publish a SNAPSHOT build to the
SNAPSHOT repo.
Post by Maxim Solodovnik
And if you have any estimates on 4.3 release, could you please share it? :)
We don't have estimates or a roadmap. But I've this on my list, because I
know you're depending on it. I have two days vacation next week. That may
be an opportunity for me to work towards a 4.3 release.

Regards,
Benedikt
Post by Maxim Solodovnik
Post by Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT build available
Could you please create it?
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created https://issues.apache.org/jira/browse/COLLECTIONS-696 and
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
On Wed, Sep 19, 2018 at 1:24 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Done: https://github.com/apache/commons-collections/pull/51
Could you please take a look at this PR?
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which includes a
unit
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Would it be possible to modify the code of
AbstractReferenceMap.java as
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>) entry).purge(ref)) {
+ ReferenceEntry<K, V> refEntry = (ReferenceEntry<K,
V>)
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType !=
ReferenceStrength.HARD &&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType !=
ReferenceStrength.HARD
Post by Maxim Solodovnik
&&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength type)
{
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value type.
+ */
+ protected boolean isValueType(final ReferenceStrength
type)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be able to
call
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive copy/paste
or
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this task
will be
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive could
you
Post by Maxim Solodovnik
please
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
Benedikt Ritter
2018-09-25 13:39:15 UTC
Permalink
Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
Post by Benedikt Ritter
Hello Maxim,
Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
could you please create 4.3-SNAPSHOT build?
I'll check whether I have permission to publish a SNAPSHOT build to the
SNAPSHOT repo.
I've deployed the latest code to
https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-collections4/4.3-SNAPSHOT/

Regards,
Benedikt
Post by Benedikt Ritter
Post by Maxim Solodovnik
And if you have any estimates on 4.3 release, could you please share it? :)
We don't have estimates or a roadmap. But I've this on my list, because I
know you're depending on it. I have two days vacation next week. That may
be an opportunity for me to work towards a 4.3 release.
Regards,
Benedikt
Post by Maxim Solodovnik
Post by Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT build available
Could you please create it?
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created https://issues.apache.org/jira/browse/COLLECTIONS-696 and
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
On Wed, Sep 19, 2018 at 1:24 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Done: https://github.com/apache/commons-collections/pull/51
Could you please take a look at this PR?
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which includes
a
Post by Maxim Solodovnik
unit
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Would it be possible to modify the code of
AbstractReferenceMap.java as
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>) entry).purge(ref)) {
+ ReferenceEntry<K, V> refEntry =
(ReferenceEntry<K,
Post by Maxim Solodovnik
V>)
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType !=
ReferenceStrength.HARD &&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType !=
ReferenceStrength.HARD
Post by Maxim Solodovnik
&&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength
type) {
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value type.
+ */
+ protected boolean isValueType(final ReferenceStrength
type)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be able
to
Post by Maxim Solodovnik
call
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive
copy/paste or
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this
task
Post by Maxim Solodovnik
will be
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive could
you
Post by Maxim Solodovnik
please
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
Maxim Solodovnik
2018-09-25 13:45:18 UTC
Permalink
Great,

Thanks a million!
Post by Benedikt Ritter
Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
Post by Benedikt Ritter
Hello Maxim,
Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
could you please create 4.3-SNAPSHOT build?
I'll check whether I have permission to publish a SNAPSHOT build to the
SNAPSHOT repo.
I've deployed the latest code to
https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-collections4/4.3-SNAPSHOT/
Regards,
Benedikt
Post by Benedikt Ritter
Post by Maxim Solodovnik
And if you have any estimates on 4.3 release, could you please share it? :)
We don't have estimates or a roadmap. But I've this on my list, because I
know you're depending on it. I have two days vacation next week. That may
be an opportunity for me to work towards a 4.3 release.
Regards,
Benedikt
Post by Maxim Solodovnik
Post by Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT build available
Could you please create it?
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created https://issues.apache.org/jira/browse/COLLECTIONS-696
and
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
On Wed, Sep 19, 2018 at 1:24 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Done: https://github.com/apache/commons-collections/pull/51
Could you please take a look at this PR?
On Thu, 6 Sep 2018 at 03:17, Gary Gregory <
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which
includes
Post by Benedikt Ritter
Post by Maxim Solodovnik
a
Post by Maxim Solodovnik
unit
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Would it be possible to modify the code of
AbstractReferenceMap.java as
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>) entry).purge(ref))
{
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ ReferenceEntry<K, V> refEntry =
(ReferenceEntry<K,
Post by Maxim Solodovnik
V>)
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType !=
ReferenceStrength.HARD &&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType !=
ReferenceStrength.HARD
Post by Maxim Solodovnik
&&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength
type) {
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value
type.
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ */
+ protected boolean isValueType(final ReferenceStrength
type)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be able
to
Post by Maxim Solodovnik
call
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive
copy/paste or
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this
task
Post by Maxim Solodovnik
will be
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive could
you
Post by Maxim Solodovnik
please
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
Maxim Solodovnik
2018-10-15 16:42:20 UTC
Permalink
Hello Benedikt,

I would like to remind you about 4.3 release :)
Post by Maxim Solodovnik
Great,
Thanks a million!
Post by Benedikt Ritter
Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
Post by Benedikt Ritter
Hello Maxim,
Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
could you please create 4.3-SNAPSHOT build?
I'll check whether I have permission to publish a SNAPSHOT build to the
SNAPSHOT repo.
I've deployed the latest code to
https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-collections4/4.3-SNAPSHOT/
Regards,
Benedikt
Post by Benedikt Ritter
Post by Maxim Solodovnik
And if you have any estimates on 4.3 release, could you please share it? :)
We don't have estimates or a roadmap. But I've this on my list, because I
know you're depending on it. I have two days vacation next week. That may
be an opportunity for me to work towards a 4.3 release.
Regards,
Benedikt
Post by Maxim Solodovnik
Post by Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT build available
Could you please create it?
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created https://issues.apache.org/jira/browse/COLLECTIONS-696 and
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
On Wed, Sep 19, 2018 at 1:24 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Done: https://github.com/apache/commons-collections/pull/51
Could you please take a look at this PR?
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which includes
a
Post by Maxim Solodovnik
unit
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Would it be possible to modify the code of
AbstractReferenceMap.java as
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>) entry).purge(ref)) {
+ ReferenceEntry<K, V> refEntry =
(ReferenceEntry<K,
Post by Maxim Solodovnik
V>)
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref) {
boolean r = parent.keyType !=
ReferenceStrength.HARD &&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType !=
ReferenceStrength.HARD
Post by Maxim Solodovnik
&&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength
type) {
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value type.
+ */
+ protected boolean isValueType(final ReferenceStrength
type)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be able
to
Post by Maxim Solodovnik
call
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive
copy/paste or
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so this
task
Post by Maxim Solodovnik
will be
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating this class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive could
you
Post by Maxim Solodovnik
please
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: user-***@commons.apache.org
For additional commands, e-mail: user-***@commons.apache.org
Gary Gregory
2018-10-15 17:06:52 UTC
Permalink
Are there any open issues we want to address for 4.3 is the SNAPSHOT OK as
is?

Gary
Post by Maxim Solodovnik
Hello Benedikt,
I would like to remind you about 4.3 release :)
Post by Maxim Solodovnik
Great,
Thanks a million!
Post by Benedikt Ritter
Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
Post by Benedikt Ritter
Hello Maxim,
Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
could you please create 4.3-SNAPSHOT build?
I'll check whether I have permission to publish a SNAPSHOT build to
the
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
SNAPSHOT repo.
I've deployed the latest code to
https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-collections4/4.3-SNAPSHOT/
Post by Maxim Solodovnik
Post by Benedikt Ritter
Regards,
Benedikt
Post by Benedikt Ritter
Post by Maxim Solodovnik
And if you have any estimates on 4.3 release, could you please share
it?
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
:)
We don't have estimates or a roadmap. But I've this on my list,
because I
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
know you're depending on it. I have two days vacation next week. That
may
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
be an opportunity for me to work towards a 4.3 release.
Regards,
Benedikt
Post by Maxim Solodovnik
Post by Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT build
available
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Could you please create it?
On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
On Wed, 19 Sep 2018 at 22:11, Gary Gregory <
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created
https://issues.apache.org/jira/browse/COLLECTIONS-696 and
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
On Wed, Sep 19, 2018 at 1:24 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Done: https://github.com/apache/commons-collections/pull/51
Could you please take a look at this PR?
On Thu, 6 Sep 2018 at 03:17, Gary Gregory <
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which
includes
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
a
Post by Maxim Solodovnik
unit
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Would it be possible to modify the code of
AbstractReferenceMap.java as
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>)
entry).purge(ref)) {
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ ReferenceEntry<K, V> refEntry =
(ReferenceEntry<K,
Post by Maxim Solodovnik
V>)
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?> ref)
{
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
boolean r = parent.keyType !=
ReferenceStrength.HARD &&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType !=
ReferenceStrength.HARD
Post by Maxim Solodovnik
&&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final ReferenceStrength
type) {
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the value
type.
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ */
+ protected boolean isValueType(final
ReferenceStrength
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
type)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be
able
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
to
Post by Maxim Solodovnik
call
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive
copy/paste or
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so
this
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
task
Post by Maxim Solodovnik
will be
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating this
class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive
could
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
you
Post by Maxim Solodovnik
please
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Maxim Solodovnik
2018-10-16 04:22:52 UTC
Permalink
Hello Gary,

SNAPSHOT works for us expected :)
There is no rush, I just want to get some ETA :)
Post by Gary Gregory
Are there any open issues we want to address for 4.3 is the SNAPSHOT OK as
is?
Gary
Post by Maxim Solodovnik
Hello Benedikt,
I would like to remind you about 4.3 release :)
Post by Maxim Solodovnik
Great,
Thanks a million!
Post by Benedikt Ritter
Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
Post by Benedikt Ritter
Hello Maxim,
Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
could you please create 4.3-SNAPSHOT build?
I'll check whether I have permission to publish a SNAPSHOT build to
the
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
SNAPSHOT repo.
I've deployed the latest code to
https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-collections4/4.3-SNAPSHOT/
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Regards,
Benedikt
Post by Benedikt Ritter
Post by Maxim Solodovnik
And if you have any estimates on 4.3 release, could you please
share
Post by Maxim Solodovnik
it?
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
:)
We don't have estimates or a roadmap. But I've this on my list,
because I
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
know you're depending on it. I have two days vacation next week.
That
Post by Maxim Solodovnik
may
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
be an opportunity for me to work towards a 4.3 release.
Regards,
Benedikt
Post by Maxim Solodovnik
On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <
Post by Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT build
available
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Could you please create it?
On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
On Wed, 19 Sep 2018 at 22:11, Gary Gregory <
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created
https://issues.apache.org/jira/browse/COLLECTIONS-696 and
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
On Wed, Sep 19, 2018 at 1:24 AM Maxim Solodovnik <
https://github.com/apache/commons-collections/pull/51
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Could you please take a look at this PR?
On Thu, 6 Sep 2018 at 03:17, Gary Gregory <
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which
includes
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
a
Post by Maxim Solodovnik
unit
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Would it be possible to modify the code of
AbstractReferenceMap.java as
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>)
entry).purge(ref)) {
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ ReferenceEntry<K, V> refEntry =
(ReferenceEntry<K,
Post by Maxim Solodovnik
V>)
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?>
ref)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
boolean r = parent.keyType !=
ReferenceStrength.HARD &&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType !=
ReferenceStrength.HARD
Post by Maxim Solodovnik
&&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final
ReferenceStrength
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
type) {
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the
value
Post by Maxim Solodovnik
type.
type
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ */
+ protected boolean isValueType(final
ReferenceStrength
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
type)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to be
able
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
to
Post by Maxim Solodovnik
call
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive
copy/paste or
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so
this
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
task
Post by Maxim Solodovnik
will be
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA from
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating this
class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more restrictive
could
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
you
Post by Maxim Solodovnik
please
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
--
WBR
Maxim aka solomax
Gary Gregory
2018-10-16 12:39:07 UTC
Permalink
Hi,

There is no ETA, and since we are all volunteers, it depends on who wants
to step up and take the time to do it.

Gary
Post by Maxim Solodovnik
Hello Gary,
SNAPSHOT works for us expected :)
There is no rush, I just want to get some ETA :)
Post by Gary Gregory
Are there any open issues we want to address for 4.3 is the SNAPSHOT OK
as
Post by Gary Gregory
is?
Gary
Post by Maxim Solodovnik
Hello Benedikt,
I would like to remind you about 4.3 release :)
Post by Maxim Solodovnik
Great,
Thanks a million!
Post by Benedikt Ritter
Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
Post by Benedikt Ritter
Hello Maxim,
Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
could you please create 4.3-SNAPSHOT build?
I'll check whether I have permission to publish a SNAPSHOT build
to
Post by Gary Gregory
Post by Maxim Solodovnik
the
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
SNAPSHOT repo.
I've deployed the latest code to
https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-collections4/4.3-SNAPSHOT/
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Regards,
Benedikt
Post by Benedikt Ritter
Post by Maxim Solodovnik
And if you have any estimates on 4.3 release, could you please
share
Post by Maxim Solodovnik
it?
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
:)
We don't have estimates or a roadmap. But I've this on my list,
because I
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
know you're depending on it. I have two days vacation next week.
That
Post by Maxim Solodovnik
may
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
be an opportunity for me to work towards a 4.3 release.
Regards,
Benedikt
Post by Maxim Solodovnik
On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <
Post by Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT build
available
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Could you please create it?
On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
On Wed, 19 Sep 2018 at 22:11, Gary Gregory <
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created
https://issues.apache.org/jira/browse/COLLECTIONS-696 and
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
On Wed, Sep 19, 2018 at 1:24 AM Maxim Solodovnik <
https://github.com/apache/commons-collections/pull/51
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Could you please take a look at this PR?
On Thu, 6 Sep 2018 at 03:17, Gary Gregory <
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub which
includes
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
a
Post by Maxim Solodovnik
unit
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Would it be possible to modify the code of
AbstractReferenceMap.java as
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>)
entry).purge(ref)) {
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ ReferenceEntry<K, V> refEntry =
(ReferenceEntry<K,
Post by Maxim Solodovnik
V>)
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?>
ref)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
boolean r = parent.keyType !=
ReferenceStrength.HARD &&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType !=
ReferenceStrength.HARD
Post by Maxim Solodovnik
&&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final
ReferenceStrength
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
type) {
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the
value
Post by Maxim Solodovnik
type.
type
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ */
+ protected boolean isValueType(final
ReferenceStrength
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
type)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method to
be
Post by Gary Gregory
Post by Maxim Solodovnik
able
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
to
Post by Maxim Solodovnik
call
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive
copy/paste or
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced so
this
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
task
Post by Maxim Solodovnik
will be
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA
from
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating this
class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more
restrictive
Post by Gary Gregory
Post by Maxim Solodovnik
could
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
you
Post by Maxim Solodovnik
please
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
--
WBR
Maxim aka solomax
Maxim Solodovnik
2018-11-13 05:37:28 UTC
Permalink
Hello Gary,

we all are volunteers :)
Why I'm asking: it will be blocker for OpenJPA release
Post by Gary Gregory
Hi,
There is no ETA, and since we are all volunteers, it depends on who wants
to step up and take the time to do it.
Gary
Post by Maxim Solodovnik
Hello Gary,
SNAPSHOT works for us expected :)
There is no rush, I just want to get some ETA :)
Post by Gary Gregory
Are there any open issues we want to address for 4.3 is the SNAPSHOT OK
as
Post by Gary Gregory
is?
Gary
On Mon, Oct 15, 2018 at 10:42 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello Benedikt,
I would like to remind you about 4.3 release :)
Post by Maxim Solodovnik
Great,
Thanks a million!
Post by Benedikt Ritter
Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
Post by Benedikt Ritter
Hello Maxim,
Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
could you please create 4.3-SNAPSHOT build?
I'll check whether I have permission to publish a SNAPSHOT build
to
Post by Gary Gregory
Post by Maxim Solodovnik
the
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
SNAPSHOT repo.
I've deployed the latest code to
https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-collections4/4.3-SNAPSHOT/
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Regards,
Benedikt
Post by Benedikt Ritter
Post by Maxim Solodovnik
And if you have any estimates on 4.3 release, could you please
share
Post by Maxim Solodovnik
it?
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
:)
We don't have estimates or a roadmap. But I've this on my list,
because I
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
know you're depending on it. I have two days vacation next week.
That
Post by Maxim Solodovnik
may
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
be an opportunity for me to work towards a 4.3 release.
Regards,
Benedikt
Post by Maxim Solodovnik
On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <
Post by Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT build
available
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Could you please create it?
On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
On Wed, 19 Sep 2018 at 22:11, Gary Gregory <
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created
https://issues.apache.org/jira/browse/COLLECTIONS-696 and
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
On Wed, Sep 19, 2018 at 1:24 AM Maxim Solodovnik <
https://github.com/apache/commons-collections/pull/51
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Could you please take a look at this PR?
On Thu, 6 Sep 2018 at 03:17, Gary Gregory <
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub
which
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
includes
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
a
Post by Maxim Solodovnik
unit
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Would it be possible to modify the code of
AbstractReferenceMap.java as
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>)
entry).purge(ref)) {
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ ReferenceEntry<K, V> refEntry =
(ReferenceEntry<K,
Post by Maxim Solodovnik
V>)
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final Reference<?>
ref)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
boolean r = parent.keyType !=
ReferenceStrength.HARD &&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType !=
ReferenceStrength.HARD
Post by Maxim Solodovnik
&&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final
ReferenceStrength
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
type) {
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to the
value
Post by Maxim Solodovnik
type.
type
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ */
+ protected boolean isValueType(final
ReferenceStrength
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
type)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method
to
Post by Maxim Solodovnik
be
Post by Gary Gregory
Post by Maxim Solodovnik
able
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
to
Post by Maxim Solodovnik
call
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without massive
copy/paste or
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be enhanced
so
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
this
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
task
Post by Maxim Solodovnik
will be
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache OpenJPA
from
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating
this
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more
restrictive
Post by Gary Gregory
Post by Maxim Solodovnik
could
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
you
Post by Maxim Solodovnik
please
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
suggest how custom purge can be implemented?
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
Gary Gregory
2018-11-13 05:50:45 UTC
Permalink
I hope someone will take the time to do this over the US Thanksgiving
holidays perhaps.

Gary
Post by Maxim Solodovnik
Hello Gary,
we all are volunteers :)
Why I'm asking: it will be blocker for OpenJPA release
Post by Gary Gregory
Hi,
There is no ETA, and since we are all volunteers, it depends on who
wants
Post by Gary Gregory
to step up and take the time to do it.
Gary
Post by Maxim Solodovnik
Hello Gary,
SNAPSHOT works for us expected :)
There is no rush, I just want to get some ETA :)
Post by Gary Gregory
Are there any open issues we want to address for 4.3 is the SNAPSHOT
OK
Post by Gary Gregory
Post by Maxim Solodovnik
as
Post by Gary Gregory
is?
Gary
On Mon, Oct 15, 2018 at 10:42 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello Benedikt,
I would like to remind you about 4.3 release :)
On Tue, 25 Sep 2018 at 20:45, Maxim Solodovnik <
Post by Maxim Solodovnik
Great,
Thanks a million!
On Tue, 25 Sep 2018 at 20:39, Benedikt Ritter <
Post by Benedikt Ritter
Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
Post by Benedikt Ritter
Hello Maxim,
Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
Post by Maxim Solodovnik
Hello,
could you please create 4.3-SNAPSHOT build?
I'll check whether I have permission to publish a SNAPSHOT
build
Post by Gary Gregory
Post by Maxim Solodovnik
to
Post by Gary Gregory
Post by Maxim Solodovnik
the
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
SNAPSHOT repo.
I've deployed the latest code to
https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-collections4/4.3-SNAPSHOT/
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Regards,
Benedikt
Post by Benedikt Ritter
Post by Maxim Solodovnik
And if you have any estimates on 4.3 release, could you
please
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
share
Post by Maxim Solodovnik
it?
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
:)
We don't have estimates or a roadmap. But I've this on my
list,
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
because I
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
know you're depending on it. I have two days vacation next
week.
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
That
Post by Maxim Solodovnik
may
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
be an opportunity for me to work towards a 4.3 release.
Regards,
Benedikt
Post by Maxim Solodovnik
On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <
Post by Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT build
available
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Could you please create it?
On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
On Wed, 19 Sep 2018 at 22:11, Gary Gregory <
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created
https://issues.apache.org/jira/browse/COLLECTIONS-696 and
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
committed you patch to git master.
Please verify and close the Jira ticket and GitHub PR.
Thank you,
Gary
On Wed, Sep 19, 2018 at 1:24 AM Maxim Solodovnik <
https://github.com/apache/commons-collections/pull/51
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Could you please take a look at this PR?
On Thu, 6 Sep 2018 at 03:17, Gary Gregory <
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub
which
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
includes
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
a
Post by Maxim Solodovnik
unit
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Would it be possible to modify the code of
AbstractReferenceMap.java as
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>)
entry).purge(ref)) {
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ ReferenceEntry<K, V> refEntry =
(ReferenceEntry<K,
Post by Maxim Solodovnik
V>)
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next = entry.next;
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref) {
+ protected boolean purge(final
Reference<?>
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
ref)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
boolean r = parent.keyType !=
ReferenceStrength.HARD &&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType !=
ReferenceStrength.HARD
Post by Maxim Solodovnik
&&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final
ReferenceStrength
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
type) {
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to
the
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
value
Post by Maxim Solodovnik
type.
specified
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
type
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ */
+ protected boolean isValueType(final
ReferenceStrength
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
type)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge method
to
Post by Maxim Solodovnik
be
Post by Gary Gregory
Post by Maxim Solodovnik
able
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
to
Post by Maxim Solodovnik
call
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without
massive
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
copy/paste or
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be
enhanced
Post by Gary Gregory
so
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
this
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
task
Post by Maxim Solodovnik
will be
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim
Solodovnik <
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache
OpenJPA
Post by Gary Gregory
Post by Maxim Solodovnik
from
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating
this
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more
restrictive
Post by Gary Gregory
Post by Maxim Solodovnik
could
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
you
Post by Maxim Solodovnik
please
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
suggest how custom purge can be
implemented?
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Gary Gregory
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
Maxim Solodovnik
2018-11-13 05:51:03 UTC
Permalink
Many thanks :)
Post by Gary Gregory
I hope someone will take the time to do this over the US Thanksgiving
holidays perhaps.
Gary
Post by Maxim Solodovnik
Hello Gary,
we all are volunteers :)
Why I'm asking: it will be blocker for OpenJPA release
Post by Gary Gregory
Hi,
There is no ETA, and since we are all volunteers, it depends on who
wants
Post by Gary Gregory
to step up and take the time to do it.
Gary
Post by Maxim Solodovnik
Hello Gary,
SNAPSHOT works for us expected :)
There is no rush, I just want to get some ETA :)
Post by Gary Gregory
Are there any open issues we want to address for 4.3 is the
SNAPSHOT
Post by Maxim Solodovnik
OK
Post by Gary Gregory
Post by Maxim Solodovnik
as
Post by Gary Gregory
is?
Gary
On Mon, Oct 15, 2018 at 10:42 AM Maxim Solodovnik <
Post by Maxim Solodovnik
Hello Benedikt,
I would like to remind you about 4.3 release :)
On Tue, 25 Sep 2018 at 20:45, Maxim Solodovnik <
Post by Maxim Solodovnik
Great,
Thanks a million!
On Tue, 25 Sep 2018 at 20:39, Benedikt Ritter <
Post by Benedikt Ritter
Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
Post by Benedikt Ritter
Hello Maxim,
Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik
<
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Hello,
could you please create 4.3-SNAPSHOT build?
I'll check whether I have permission to publish a SNAPSHOT
build
Post by Gary Gregory
Post by Maxim Solodovnik
to
Post by Gary Gregory
Post by Maxim Solodovnik
the
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
SNAPSHOT repo.
I've deployed the latest code to
https://repository.apache.org/content/repositories/snapshots/org/apache/commons/commons-collections4/4.3-SNAPSHOT/
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Regards,
Benedikt
Post by Benedikt Ritter
Post by Maxim Solodovnik
And if you have any estimates on 4.3 release, could you
please
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
share
Post by Maxim Solodovnik
it?
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
:)
We don't have estimates or a roadmap. But I've this on my
list,
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
because I
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
know you're depending on it. I have two days vacation next
week.
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
That
Post by Maxim Solodovnik
may
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
be an opportunity for me to work towards a 4.3 release.
Regards,
Benedikt
Post by Maxim Solodovnik
On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <
Post by Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT
build
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
available
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Could you please create it?
On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <
Post by Maxim Solodovnik
Hello Gary,
I have tested changes, everything works as expected
Thanks a lot!
I have closed PR, but have no rights to close JIRA :(
Do you have any plans for 4.3 release?
On Wed, 19 Sep 2018 at 22:11, Gary Gregory <
Post by Gary Gregory
Maxim,
Thank you for your patch.
I created
https://issues.apache.org/jira/browse/COLLECTIONS-696 and
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
committed you patch to git master.
Please verify and close the Jira ticket and GitHub
PR.
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Thank you,
Gary
On Wed, Sep 19, 2018 at 1:24 AM Maxim Solodovnik <
https://github.com/apache/commons-collections/pull/51
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Could you please take a look at this PR?
On Thu, 6 Sep 2018 at 03:17, Gary Gregory <
Post by Gary Gregory
Hi,
Your best shot would be to submit a PR on GitHub
which
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
includes
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
a
Post by Maxim Solodovnik
unit
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
test
Post by Gary Gregory
that exercises the new code.
https://github.com/apache/commons-collections
Thank you,
Gary
On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik
<
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Would it be possible to modify the code of
AbstractReferenceMap.java as
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
follows?
diff --git
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
index 0eda632f..81f60b4b 100644
---
a/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+++
b/src/main/java/org/apache/commons/collections4/map/AbstractReferenceMap.java
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
@@ -400,13 +400,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
HashEntry<K, V> previous = null;
HashEntry<K, V> entry = data[index];
while (entry != null) {
- if (((ReferenceEntry<K, V>)
entry).purge(ref)) {
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ ReferenceEntry<K, V> refEntry =
(ReferenceEntry<K,
Post by Maxim Solodovnik
V>)
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
entry;
Post by Gary Gregory
Post by Maxim Solodovnik
+ if (refEntry.purge(ref)) {
if (previous == null) {
data[index] = entry.next;
} else {
previous.next =
entry.next;
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
}
this.size--;
+ refEntry.onPurge();
return;
}
previous = entry;
@@ -721,12 +723,15 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
throw new Error();
}
+ protected void onPurge() {
+ }
+
/**
* Purges the specified reference
*/
- boolean purge(final Reference<?> ref)
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ protected boolean purge(final
Reference<?>
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
ref)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
boolean r = parent.keyType !=
ReferenceStrength.HARD &&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
key ==
Post by Gary Gregory
Post by Maxim Solodovnik
ref;
r = r || parent.valueType !=
ReferenceStrength.HARD
Post by Maxim Solodovnik
&&
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
value
Post by Gary Gregory
Post by Maxim Solodovnik
== ref;
if (r) {
@@ -1073,4 +1078,17 @@ public abstract class
AbstractReferenceMap<K, V>
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
extends AbstractHashedMap<K, V>
protected boolean isKeyType(final
ReferenceStrength
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
type) {
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
return this.keyType == type;
}
+
+ /**
+ * Provided protected read-only access to
the
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
value
Post by Maxim Solodovnik
type.
specified
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
type
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ */
+ protected boolean isValueType(final
ReferenceStrength
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
type)
Post by Maxim Solodovnik
{
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
+ return this.valueType == type;
+ }
+
+ public boolean isPurgeValues() {
+ return purgeValues;
+ }
}
On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
Post by Maxim Solodovnik
Thanks a lot for the answer,
OpenJPA ReferenceHashMap overrides purge
method
Post by Maxim Solodovnik
Post by Gary Gregory
to
Post by Maxim Solodovnik
be
Post by Gary Gregory
Post by Maxim Solodovnik
able
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
to
Post by Maxim Solodovnik
call
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
custom methods keyExpired/valueExpired [1]
I see no way to migrate this code without
massive
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
copy/paste or
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
reflection
Post by Maxim Solodovnik
...
Maybe you can suggest something?
Or maybe commons-collections API can be
enhanced
Post by Gary Gregory
so
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
this
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
task
Post by Maxim Solodovnik
will be
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
trivial :)
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L138
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
On Mon, 3 Sep 2018 at 20:03, Julio Oliveira
Post by Julio Oliveira
What is realy your problem??..
On Sat, Sep 1, 2018, 5:46 AM Maxim
Solodovnik <
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
Hello,
I'm trying to migrate code of Apache
OpenJPA
Post by Gary Gregory
Post by Maxim Solodovnik
from
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
commons-collections
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
to commons-collections4
The only real issue so far with migrating
this
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
class
https://github.com/apache/openjpa/blob/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/ReferenceHashMap.java#L112
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
code of commons-collections4 is more
restrictive
Post by Gary Gregory
Post by Maxim Solodovnik
could
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
you
Post by Maxim Solodovnik
please
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
suggest how custom purge can be
implemented?
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Julio Oliveira
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Gary Gregory
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Benedikt Ritter
Post by Benedikt Ritter
Post by Maxim Solodovnik
Post by Maxim Solodovnik
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
---------------------------------------------------------------------
Post by Gary Gregory
Post by Maxim Solodovnik
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
--
WBR
Maxim aka solomax
Loading...