Help with migrating one of OpenJPA classes to commons-collections4

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Help with migrating one of OpenJPA classes to commons-collections4

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[collections] Help with migrating one of OpenJPA classes to commons-collections4

Maxim Solodovnik
Correct prefix is added to subject

On Sat, Sep 1, 2018 at 3:45 PM Maxim Solodovnik <[hidden email]> wrote:

>
> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

Julio Oliveira
In reply to this post by Maxim Solodovnik
What is realy your problem??..

On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <[hidden email]> wrote:

> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

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
<[hidden email]> wrote:

>
> What is realy your problem??..
>
> On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <[hidden email]> wrote:
>
> > 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: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >



--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

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
          * @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;
+    }
 }


On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <[hidden email]> wrote:

> 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
> <[hidden email]> wrote:
> >
> > What is realy your problem??..
> >
> > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <[hidden email]>
> wrote:
> >
> > > 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: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
>
>
>
> --
> WBR
> Maxim aka solomax
>


--
WBR
Maxim aka solomax
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

garydgregory
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

On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <[hidden email]>
wrote:

> 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;
> +    }
>  }
>
>
> On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <[hidden email]>
> wrote:
>
> > 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
> > <[hidden email]> wrote:
> > >
> > > What is realy your problem??..
> > >
> > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <[hidden email]>
> > wrote:
> > >
> > > > 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: [hidden email]
> > > > For additional commands, e-mail: [hidden email]
> > > >
> > > >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>
>
> --
> WBR
> Maxim aka solomax
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

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 <[hidden email]> wrote:

>
> 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
>
> On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <[hidden email]>
> wrote:
>
> > 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;
> > +    }
> >  }
> >
> >
> > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <[hidden email]>
> > wrote:
> >
> > > 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
> > > <[hidden email]> wrote:
> > > >
> > > > What is realy your problem??..
> > > >
> > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <[hidden email]>
> > > wrote:
> > > >
> > > > > 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: [hidden email]
> > > > > For additional commands, e-mail: [hidden email]
> > > > >
> > > > >
> > >
> > >
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> > >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >



--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

garydgregory
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 <[hidden email]>
wrote:

> 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 <[hidden email]> wrote:
> >
> > 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
> >
> > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <[hidden email]>
> > wrote:
> >
> > > 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;
> > > +    }
> > >  }
> > >
> > >
> > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <[hidden email]>
> > > wrote:
> > >
> > > > 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
> > > > <[hidden email]> wrote:
> > > > >
> > > > > What is realy your problem??..
> > > > >
> > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
> [hidden email]>
> > > > wrote:
> > > > >
> > > > > > 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: [hidden email]
> > > > > > For additional commands, e-mail: [hidden email]
> > > > > >
> > > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > WBR
> > > > Maxim aka solomax
> > > >
> > >
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> > >
>
>
>
> --
> WBR
> Maxim aka solomax
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

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 <[hidden email]> wrote:

>
> 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 <[hidden email]>
> wrote:
>
> > 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 <[hidden email]> wrote:
> > >
> > > 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
> > >
> > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <[hidden email]>
> > > wrote:
> > >
> > > > 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;
> > > > +    }
> > > >  }
> > > >
> > > >
> > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <[hidden email]>
> > > > wrote:
> > > >
> > > > > 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
> > > > > <[hidden email]> wrote:
> > > > > >
> > > > > > What is realy your problem??..
> > > > > >
> > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
> > [hidden email]>
> > > > > wrote:
> > > > > >
> > > > > > > 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: [hidden email]
> > > > > > > For additional commands, e-mail: [hidden email]
> > > > > > >
> > > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > WBR
> > > > > Maxim aka solomax
> > > > >
> > > >
> > > >
> > > > --
> > > > WBR
> > > > Maxim aka solomax
> > > >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >



--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

Maxim Solodovnik
One more question: it seems there is no 4.3-SNAPSHOT build available
Could you please create it?

On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <[hidden email]> wrote:

>
> 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 <[hidden email]> wrote:
> >
> > 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 <[hidden email]>
> > wrote:
> >
> > > 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 <[hidden email]> wrote:
> > > >
> > > > 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
> > > >
> > > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <[hidden email]>
> > > > wrote:
> > > >
> > > > > 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;
> > > > > +    }
> > > > >  }
> > > > >
> > > > >
> > > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <[hidden email]>
> > > > > wrote:
> > > > >
> > > > > > 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
> > > > > > <[hidden email]> wrote:
> > > > > > >
> > > > > > > What is realy your problem??..
> > > > > > >
> > > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
> > > [hidden email]>
> > > > > > wrote:
> > > > > > >
> > > > > > > > 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: [hidden email]
> > > > > > > > For additional commands, e-mail: [hidden email]
> > > > > > > >
> > > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > WBR
> > > > > > Maxim aka solomax
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > WBR
> > > > > Maxim aka solomax
> > > > >
> > >
> > >
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
>
>
>
> --
> WBR
> Maxim aka solomax



--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

Maxim Solodovnik
Hello,

could you please create 4.3-SNAPSHOT build?

And if you have any estimates on 4.3 release, could you please share it? :)



On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <[hidden email]> wrote:

> One more question: it seems there is no 4.3-SNAPSHOT build available
> Could you please create it?
>
> On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <[hidden email]>
> wrote:
> >
> > 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 <[hidden email]>
> wrote:
> > >
> > > 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 <[hidden email]
> >
> > > wrote:
> > >
> > > > 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 <[hidden email]>
> wrote:
> > > > >
> > > > > 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
> > > > >
> > > > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
> [hidden email]>
> > > > > wrote:
> > > > >
> > > > > > 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;
> > > > > > +    }
> > > > > >  }
> > > > > >
> > > > > >
> > > > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
> [hidden email]>
> > > > > > wrote:
> > > > > >
> > > > > > > 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
> > > > > > > <[hidden email]> wrote:
> > > > > > > >
> > > > > > > > What is realy your problem??..
> > > > > > > >
> > > > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
> > > > [hidden email]>
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > > 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:
> [hidden email]
> > > > > > > > > For additional commands, e-mail:
> [hidden email]
> > > > > > > > >
> > > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > WBR
> > > > > > > Maxim aka solomax
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > WBR
> > > > > > Maxim aka solomax
> > > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > WBR
> > > > Maxim aka solomax
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [hidden email]
> > > > For additional commands, e-mail: [hidden email]
> > > >
> > > >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
>
>
>
> --
> WBR
> Maxim aka solomax
>


--
WBR
Maxim aka solomax
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

Benedikt Ritter-4
Hello Maxim,
Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
[hidden email]>:

> 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.


>
> 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


>
>
>
> On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <[hidden email]>
> wrote:
>
> > One more question: it seems there is no 4.3-SNAPSHOT build available
> > Could you please create it?
> >
> > On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <[hidden email]>
> > wrote:
> > >
> > > 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 <[hidden email]>
> > wrote:
> > > >
> > > > 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 <
> [hidden email]
> > >
> > > > wrote:
> > > >
> > > > > 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 <[hidden email]>
> > wrote:
> > > > > >
> > > > > > 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
> > > > > >
> > > > > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
> > [hidden email]>
> > > > > > wrote:
> > > > > >
> > > > > > > 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;
> > > > > > > +    }
> > > > > > >  }
> > > > > > >
> > > > > > >
> > > > > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
> > [hidden email]>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > 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
> > > > > > > > <[hidden email]> wrote:
> > > > > > > > >
> > > > > > > > > What is realy your problem??..
> > > > > > > > >
> > > > > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
> > > > > [hidden email]>
> > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > 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:
> > [hidden email]
> > > > > > > > > > For additional commands, e-mail:
> > [hidden email]
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > WBR
> > > > > > > > Maxim aka solomax
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > WBR
> > > > > > > Maxim aka solomax
> > > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > WBR
> > > > > Maxim aka solomax
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [hidden email]
> > > > > For additional commands, e-mail: [hidden email]
> > > > >
> > > > >
> > >
> > >
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>
>
> --
> WBR
> Maxim aka solomax
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

Benedikt Ritter-4
Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
[hidden email]>:

> Hello Maxim,
> Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
> [hidden email]>:
>
>> 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


>
>
>>
>> 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
>
>
>>
>>
>>
>> On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <[hidden email]>
>> wrote:
>>
>> > One more question: it seems there is no 4.3-SNAPSHOT build available
>> > Could you please create it?
>> >
>> > On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <[hidden email]>
>> > wrote:
>> > >
>> > > 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 <[hidden email]>
>> > wrote:
>> > > >
>> > > > 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 <
>> [hidden email]
>> > >
>> > > > wrote:
>> > > >
>> > > > > 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 <[hidden email]
>> >
>> > wrote:
>> > > > > >
>> > > > > > 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
>> > > > > >
>> > > > > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
>> > [hidden email]>
>> > > > > > wrote:
>> > > > > >
>> > > > > > > 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;
>> > > > > > > +    }
>> > > > > > >  }
>> > > > > > >
>> > > > > > >
>> > > > > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
>> > [hidden email]>
>> > > > > > > wrote:
>> > > > > > >
>> > > > > > > > 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
>> > > > > > > > <[hidden email]> wrote:
>> > > > > > > > >
>> > > > > > > > > What is realy your problem??..
>> > > > > > > > >
>> > > > > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
>> > > > > [hidden email]>
>> > > > > > > > wrote:
>> > > > > > > > >
>> > > > > > > > > > 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:
>> > [hidden email]
>> > > > > > > > > > For additional commands, e-mail:
>> > [hidden email]
>> > > > > > > > > >
>> > > > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > > >
>> > > > > > > > --
>> > > > > > > > WBR
>> > > > > > > > Maxim aka solomax
>> > > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > > --
>> > > > > > > WBR
>> > > > > > > Maxim aka solomax
>> > > > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > --
>> > > > > WBR
>> > > > > Maxim aka solomax
>> > > > >
>> > > > >
>> ---------------------------------------------------------------------
>> > > > > To unsubscribe, e-mail: [hidden email]
>> > > > > For additional commands, e-mail: [hidden email]
>> > > > >
>> > > > >
>> > >
>> > >
>> > >
>> > > --
>> > > WBR
>> > > Maxim aka solomax
>> >
>> >
>> >
>> > --
>> > WBR
>> > Maxim aka solomax
>> >
>>
>>
>> --
>> WBR
>> Maxim aka solomax
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

Maxim Solodovnik
Great,

Thanks a million!

On Tue, 25 Sep 2018 at 20:39, Benedikt Ritter <[hidden email]> wrote:

> Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
> [hidden email]>:
>
> > Hello Maxim,
> > Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
> > [hidden email]>:
> >
> >> 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
>
>
> >
> >
> >>
> >> 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
> >
> >
> >>
> >>
> >>
> >> On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <[hidden email]>
> >> wrote:
> >>
> >> > One more question: it seems there is no 4.3-SNAPSHOT build available
> >> > Could you please create it?
> >> >
> >> > On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <[hidden email]>
> >> > wrote:
> >> > >
> >> > > 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 <[hidden email]>
> >> > wrote:
> >> > > >
> >> > > > 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 <
> >> [hidden email]
> >> > >
> >> > > > wrote:
> >> > > >
> >> > > > > 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 <
> [hidden email]
> >> >
> >> > wrote:
> >> > > > > >
> >> > > > > > 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
> >> > > > > >
> >> > > > > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
> >> > [hidden email]>
> >> > > > > > wrote:
> >> > > > > >
> >> > > > > > > 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;
> >> > > > > > > +    }
> >> > > > > > >  }
> >> > > > > > >
> >> > > > > > >
> >> > > > > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
> >> > [hidden email]>
> >> > > > > > > wrote:
> >> > > > > > >
> >> > > > > > > > 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
> >> > > > > > > > <[hidden email]> wrote:
> >> > > > > > > > >
> >> > > > > > > > > What is realy your problem??..
> >> > > > > > > > >
> >> > > > > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
> >> > > > > [hidden email]>
> >> > > > > > > > wrote:
> >> > > > > > > > >
> >> > > > > > > > > > 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:
> >> > [hidden email]
> >> > > > > > > > > > For additional commands, e-mail:
> >> > [hidden email]
> >> > > > > > > > > >
> >> > > > > > > > > >
> >> > > > > > > >
> >> > > > > > > >
> >> > > > > > > >
> >> > > > > > > > --
> >> > > > > > > > WBR
> >> > > > > > > > Maxim aka solomax
> >> > > > > > > >
> >> > > > > > >
> >> > > > > > >
> >> > > > > > > --
> >> > > > > > > WBR
> >> > > > > > > Maxim aka solomax
> >> > > > > > >
> >> > > > >
> >> > > > >
> >> > > > >
> >> > > > > --
> >> > > > > WBR
> >> > > > > Maxim aka solomax
> >> > > > >
> >> > > > >
> >> ---------------------------------------------------------------------
> >> > > > > To unsubscribe, e-mail: [hidden email]
> >> > > > > For additional commands, e-mail: [hidden email]
> >> > > > >
> >> > > > >
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > WBR
> >> > > Maxim aka solomax
> >> >
> >> >
> >> >
> >> > --
> >> > WBR
> >> > Maxim aka solomax
> >> >
> >>
> >>
> >> --
> >> WBR
> >> Maxim aka solomax
> >>
> >
>


--
WBR
Maxim aka solomax
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

Maxim Solodovnik
Hello Benedikt,

I would like to remind you about 4.3 release :)

On Tue, 25 Sep 2018 at 20:45, Maxim Solodovnik <[hidden email]> wrote:

>
> Great,
>
> Thanks a million!
>
> On Tue, 25 Sep 2018 at 20:39, Benedikt Ritter <[hidden email]> wrote:
>>
>> Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
>> [hidden email]>:
>>
>> > Hello Maxim,
>> > Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
>> > [hidden email]>:
>> >
>> >> 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
>>
>>
>> >
>> >
>> >>
>> >> 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
>> >
>> >
>> >>
>> >>
>> >>
>> >> On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <[hidden email]>
>> >> wrote:
>> >>
>> >> > One more question: it seems there is no 4.3-SNAPSHOT build available
>> >> > Could you please create it?
>> >> >
>> >> > On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <[hidden email]>
>> >> > wrote:
>> >> > >
>> >> > > 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 <[hidden email]>
>> >> > wrote:
>> >> > > >
>> >> > > > 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 <
>> >> [hidden email]
>> >> > >
>> >> > > > wrote:
>> >> > > >
>> >> > > > > 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 <[hidden email]
>> >> >
>> >> > wrote:
>> >> > > > > >
>> >> > > > > > 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
>> >> > > > > >
>> >> > > > > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
>> >> > [hidden email]>
>> >> > > > > > wrote:
>> >> > > > > >
>> >> > > > > > > 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;
>> >> > > > > > > +    }
>> >> > > > > > >  }
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
>> >> > [hidden email]>
>> >> > > > > > > wrote:
>> >> > > > > > >
>> >> > > > > > > > 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
>> >> > > > > > > > <[hidden email]> wrote:
>> >> > > > > > > > >
>> >> > > > > > > > > What is realy your problem??..
>> >> > > > > > > > >
>> >> > > > > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
>> >> > > > > [hidden email]>
>> >> > > > > > > > wrote:
>> >> > > > > > > > >
>> >> > > > > > > > > > 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:
>> >> > [hidden email]
>> >> > > > > > > > > > For additional commands, e-mail:
>> >> > [hidden email]
>> >> > > > > > > > > >
>> >> > > > > > > > > >
>> >> > > > > > > >
>> >> > > > > > > >
>> >> > > > > > > >
>> >> > > > > > > > --
>> >> > > > > > > > WBR
>> >> > > > > > > > Maxim aka solomax
>> >> > > > > > > >
>> >> > > > > > >
>> >> > > > > > >
>> >> > > > > > > --
>> >> > > > > > > WBR
>> >> > > > > > > Maxim aka solomax
>> >> > > > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > >
>> >> > > > > --
>> >> > > > > WBR
>> >> > > > > Maxim aka solomax
>> >> > > > >
>> >> > > > >
>> >> ---------------------------------------------------------------------
>> >> > > > > To unsubscribe, e-mail: [hidden email]
>> >> > > > > For additional commands, e-mail: [hidden email]
>> >> > > > >
>> >> > > > >
>> >> > >
>> >> > >
>> >> > >
>> >> > > --
>> >> > > WBR
>> >> > > Maxim aka solomax
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > WBR
>> >> > Maxim aka solomax
>> >> >
>> >>
>> >>
>> >> --
>> >> WBR
>> >> Maxim aka solomax
>> >>
>> >
>
>
>
> --
> WBR
> Maxim aka solomax



--
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

garydgregory
Are there any open issues we want to address for 4.3 is the SNAPSHOT OK as
is?

Gary

On Mon, Oct 15, 2018 at 10:42 AM Maxim Solodovnik <[hidden email]>
wrote:

> Hello Benedikt,
>
> I would like to remind you about 4.3 release :)
>
> On Tue, 25 Sep 2018 at 20:45, Maxim Solodovnik <[hidden email]>
> wrote:
> >
> > Great,
> >
> > Thanks a million!
> >
> > On Tue, 25 Sep 2018 at 20:39, Benedikt Ritter <[hidden email]>
> wrote:
> >>
> >> Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
> >> [hidden email]>:
> >>
> >> > Hello Maxim,
> >> > Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
> >> > [hidden email]>:
> >> >
> >> >> 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
> >>
> >>
> >> >
> >> >
> >> >>
> >> >> 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
> >> >
> >> >
> >> >>
> >> >>
> >> >>
> >> >> On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <[hidden email]
> >
> >> >> wrote:
> >> >>
> >> >> > One more question: it seems there is no 4.3-SNAPSHOT build
> available
> >> >> > Could you please create it?
> >> >> >
> >> >> > On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <
> [hidden email]>
> >> >> > wrote:
> >> >> > >
> >> >> > > 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 <
> [hidden email]>
> >> >> > wrote:
> >> >> > > >
> >> >> > > > 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 <
> >> >> [hidden email]
> >> >> > >
> >> >> > > > wrote:
> >> >> > > >
> >> >> > > > > 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 <
> [hidden email]
> >> >> >
> >> >> > wrote:
> >> >> > > > > >
> >> >> > > > > > 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
> >> >> > > > > >
> >> >> > > > > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
> >> >> > [hidden email]>
> >> >> > > > > > wrote:
> >> >> > > > > >
> >> >> > > > > > > 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;
> >> >> > > > > > > +    }
> >> >> > > > > > >  }
> >> >> > > > > > >
> >> >> > > > > > >
> >> >> > > > > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
> >> >> > [hidden email]>
> >> >> > > > > > > wrote:
> >> >> > > > > > >
> >> >> > > > > > > > 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
> >> >> > > > > > > > <[hidden email]> wrote:
> >> >> > > > > > > > >
> >> >> > > > > > > > > What is realy your problem??..
> >> >> > > > > > > > >
> >> >> > > > > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
> >> >> > > > > [hidden email]>
> >> >> > > > > > > > wrote:
> >> >> > > > > > > > >
> >> >> > > > > > > > > > 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:
> >> >> > [hidden email]
> >> >> > > > > > > > > > For additional commands, e-mail:
> >> >> > [hidden email]
> >> >> > > > > > > > > >
> >> >> > > > > > > > > >
> >> >> > > > > > > >
> >> >> > > > > > > >
> >> >> > > > > > > >
> >> >> > > > > > > > --
> >> >> > > > > > > > WBR
> >> >> > > > > > > > Maxim aka solomax
> >> >> > > > > > > >
> >> >> > > > > > >
> >> >> > > > > > >
> >> >> > > > > > > --
> >> >> > > > > > > WBR
> >> >> > > > > > > Maxim aka solomax
> >> >> > > > > > >
> >> >> > > > >
> >> >> > > > >
> >> >> > > > >
> >> >> > > > > --
> >> >> > > > > WBR
> >> >> > > > > Maxim aka solomax
> >> >> > > > >
> >> >> > > > >
> >> >> ---------------------------------------------------------------------
> >> >> > > > > To unsubscribe, e-mail: [hidden email]
> >> >> > > > > For additional commands, e-mail:
> [hidden email]
> >> >> > > > >
> >> >> > > > >
> >> >> > >
> >> >> > >
> >> >> > >
> >> >> > > --
> >> >> > > WBR
> >> >> > > Maxim aka solomax
> >> >> >
> >> >> >
> >> >> >
> >> >> > --
> >> >> > WBR
> >> >> > Maxim aka solomax
> >> >> >
> >> >>
> >> >>
> >> >> --
> >> >> WBR
> >> >> Maxim aka solomax
> >> >>
> >> >
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
>
>
>
> --
> WBR
> Maxim aka solomax
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

Maxim Solodovnik
Hello Gary,

SNAPSHOT works for us expected :)
There is no rush, I just want to get some ETA :)

On Tue, 16 Oct 2018 at 00:07, Gary Gregory <[hidden email]> wrote:

> Are there any open issues we want to address for 4.3 is the SNAPSHOT OK as
> is?
>
> Gary
>
> On Mon, Oct 15, 2018 at 10:42 AM Maxim Solodovnik <[hidden email]>
> wrote:
>
> > Hello Benedikt,
> >
> > I would like to remind you about 4.3 release :)
> >
> > On Tue, 25 Sep 2018 at 20:45, Maxim Solodovnik <[hidden email]>
> > wrote:
> > >
> > > Great,
> > >
> > > Thanks a million!
> > >
> > > On Tue, 25 Sep 2018 at 20:39, Benedikt Ritter <[hidden email]>
> > wrote:
> > >>
> > >> Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
> > >> [hidden email]>:
> > >>
> > >> > Hello Maxim,
> > >> > Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
> > >> > [hidden email]>:
> > >> >
> > >> >> 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
> > >>
> > >>
> > >> >
> > >> >
> > >> >>
> > >> >> 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
> > >> >
> > >> >
> > >> >>
> > >> >>
> > >> >>
> > >> >> On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <
> [hidden email]
> > >
> > >> >> wrote:
> > >> >>
> > >> >> > One more question: it seems there is no 4.3-SNAPSHOT build
> > available
> > >> >> > Could you please create it?
> > >> >> >
> > >> >> > On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <
> > [hidden email]>
> > >> >> > wrote:
> > >> >> > >
> > >> >> > > 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 <
> > [hidden email]>
> > >> >> > wrote:
> > >> >> > > >
> > >> >> > > > 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 <
> > >> >> [hidden email]
> > >> >> > >
> > >> >> > > > wrote:
> > >> >> > > >
> > >> >> > > > > 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 <
> > [hidden email]
> > >> >> >
> > >> >> > wrote:
> > >> >> > > > > >
> > >> >> > > > > > 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
> > >> >> > > > > >
> > >> >> > > > > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
> > >> >> > [hidden email]>
> > >> >> > > > > > wrote:
> > >> >> > > > > >
> > >> >> > > > > > > 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;
> > >> >> > > > > > > +    }
> > >> >> > > > > > >  }
> > >> >> > > > > > >
> > >> >> > > > > > >
> > >> >> > > > > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
> > >> >> > [hidden email]>
> > >> >> > > > > > > wrote:
> > >> >> > > > > > >
> > >> >> > > > > > > > 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
> > >> >> > > > > > > > <[hidden email]> wrote:
> > >> >> > > > > > > > >
> > >> >> > > > > > > > > What is realy your problem??..
> > >> >> > > > > > > > >
> > >> >> > > > > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
> > >> >> > > > > [hidden email]>
> > >> >> > > > > > > > wrote:
> > >> >> > > > > > > > >
> > >> >> > > > > > > > > > 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:
> > >> >> > [hidden email]
> > >> >> > > > > > > > > > For additional commands, e-mail:
> > >> >> > [hidden email]
> > >> >> > > > > > > > > >
> > >> >> > > > > > > > > >
> > >> >> > > > > > > >
> > >> >> > > > > > > >
> > >> >> > > > > > > >
> > >> >> > > > > > > > --
> > >> >> > > > > > > > WBR
> > >> >> > > > > > > > Maxim aka solomax
> > >> >> > > > > > > >
> > >> >> > > > > > >
> > >> >> > > > > > >
> > >> >> > > > > > > --
> > >> >> > > > > > > WBR
> > >> >> > > > > > > Maxim aka solomax
> > >> >> > > > > > >
> > >> >> > > > >
> > >> >> > > > >
> > >> >> > > > >
> > >> >> > > > > --
> > >> >> > > > > WBR
> > >> >> > > > > Maxim aka solomax
> > >> >> > > > >
> > >> >> > > > >
> > >> >>
> ---------------------------------------------------------------------
> > >> >> > > > > To unsubscribe, e-mail:
> [hidden email]
> > >> >> > > > > For additional commands, e-mail:
> > [hidden email]
> > >> >> > > > >
> > >> >> > > > >
> > >> >> > >
> > >> >> > >
> > >> >> > >
> > >> >> > > --
> > >> >> > > WBR
> > >> >> > > Maxim aka solomax
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> > --
> > >> >> > WBR
> > >> >> > Maxim aka solomax
> > >> >> >
> > >> >>
> > >> >>
> > >> >> --
> > >> >> WBR
> > >> >> Maxim aka solomax
> > >> >>
> > >> >
> > >
> > >
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>


--
WBR
Maxim aka solomax
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

garydgregory
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

On Mon, Oct 15, 2018, 22:23 Maxim Solodovnik <[hidden email]> wrote:

> Hello Gary,
>
> SNAPSHOT works for us expected :)
> There is no rush, I just want to get some ETA :)
>
> On Tue, 16 Oct 2018 at 00:07, Gary Gregory <[hidden email]> wrote:
>
> > Are there any open issues we want to address for 4.3 is the SNAPSHOT OK
> as
> > is?
> >
> > Gary
> >
> > On Mon, Oct 15, 2018 at 10:42 AM Maxim Solodovnik <[hidden email]>
> > wrote:
> >
> > > Hello Benedikt,
> > >
> > > I would like to remind you about 4.3 release :)
> > >
> > > On Tue, 25 Sep 2018 at 20:45, Maxim Solodovnik <[hidden email]>
> > > wrote:
> > > >
> > > > Great,
> > > >
> > > > Thanks a million!
> > > >
> > > > On Tue, 25 Sep 2018 at 20:39, Benedikt Ritter <[hidden email]>
> > > wrote:
> > > >>
> > > >> Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
> > > >> [hidden email]>:
> > > >>
> > > >> > Hello Maxim,
> > > >> > Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
> > > >> > [hidden email]>:
> > > >> >
> > > >> >> 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
> > > >>
> > > >>
> > > >> >
> > > >> >
> > > >> >>
> > > >> >> 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
> > > >> >
> > > >> >
> > > >> >>
> > > >> >>
> > > >> >>
> > > >> >> On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <
> > [hidden email]
> > > >
> > > >> >> wrote:
> > > >> >>
> > > >> >> > One more question: it seems there is no 4.3-SNAPSHOT build
> > > available
> > > >> >> > Could you please create it?
> > > >> >> >
> > > >> >> > On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <
> > > [hidden email]>
> > > >> >> > wrote:
> > > >> >> > >
> > > >> >> > > 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 <
> > > [hidden email]>
> > > >> >> > wrote:
> > > >> >> > > >
> > > >> >> > > > 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 <
> > > >> >> [hidden email]
> > > >> >> > >
> > > >> >> > > > wrote:
> > > >> >> > > >
> > > >> >> > > > > 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 <
> > > [hidden email]
> > > >> >> >
> > > >> >> > wrote:
> > > >> >> > > > > >
> > > >> >> > > > > > 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
> > > >> >> > > > > >
> > > >> >> > > > > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
> > > >> >> > [hidden email]>
> > > >> >> > > > > > wrote:
> > > >> >> > > > > >
> > > >> >> > > > > > > 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;
> > > >> >> > > > > > > +    }
> > > >> >> > > > > > >  }
> > > >> >> > > > > > >
> > > >> >> > > > > > >
> > > >> >> > > > > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
> > > >> >> > [hidden email]>
> > > >> >> > > > > > > wrote:
> > > >> >> > > > > > >
> > > >> >> > > > > > > > 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
> > > >> >> > > > > > > > <[hidden email]> wrote:
> > > >> >> > > > > > > > >
> > > >> >> > > > > > > > > What is realy your problem??..
> > > >> >> > > > > > > > >
> > > >> >> > > > > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
> > > >> >> > > > > [hidden email]>
> > > >> >> > > > > > > > wrote:
> > > >> >> > > > > > > > >
> > > >> >> > > > > > > > > > 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:
> > > >> >> > [hidden email]
> > > >> >> > > > > > > > > > For additional commands, e-mail:
> > > >> >> > [hidden email]
> > > >> >> > > > > > > > > >
> > > >> >> > > > > > > > > >
> > > >> >> > > > > > > >
> > > >> >> > > > > > > >
> > > >> >> > > > > > > >
> > > >> >> > > > > > > > --
> > > >> >> > > > > > > > WBR
> > > >> >> > > > > > > > Maxim aka solomax
> > > >> >> > > > > > > >
> > > >> >> > > > > > >
> > > >> >> > > > > > >
> > > >> >> > > > > > > --
> > > >> >> > > > > > > WBR
> > > >> >> > > > > > > Maxim aka solomax
> > > >> >> > > > > > >
> > > >> >> > > > >
> > > >> >> > > > >
> > > >> >> > > > >
> > > >> >> > > > > --
> > > >> >> > > > > WBR
> > > >> >> > > > > Maxim aka solomax
> > > >> >> > > > >
> > > >> >> > > > >
> > > >> >>
> > ---------------------------------------------------------------------
> > > >> >> > > > > To unsubscribe, e-mail:
> > [hidden email]
> > > >> >> > > > > For additional commands, e-mail:
> > > [hidden email]
> > > >> >> > > > >
> > > >> >> > > > >
> > > >> >> > >
> > > >> >> > >
> > > >> >> > >
> > > >> >> > > --
> > > >> >> > > WBR
> > > >> >> > > Maxim aka solomax
> > > >> >> >
> > > >> >> >
> > > >> >> >
> > > >> >> > --
> > > >> >> > WBR
> > > >> >> > Maxim aka solomax
> > > >> >> >
> > > >> >>
> > > >> >>
> > > >> >> --
> > > >> >> WBR
> > > >> >> Maxim aka solomax
> > > >> >>
> > > >> >
> > > >
> > > >
> > > >
> > > > --
> > > > WBR
> > > > Maxim aka solomax
> > >
> > >
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
>
>
> --
> WBR
> Maxim aka solomax
>
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

Maxim Solodovnik
Hello Gary,

we all are volunteers :)
Why I'm asking: it will be blocker for OpenJPA release

On Tue, 16 Oct 2018 at 19:39, Gary Gregory <[hidden email]> wrote:

> 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
>
> On Mon, Oct 15, 2018, 22:23 Maxim Solodovnik <[hidden email]> wrote:
>
> > Hello Gary,
> >
> > SNAPSHOT works for us expected :)
> > There is no rush, I just want to get some ETA :)
> >
> > On Tue, 16 Oct 2018 at 00:07, Gary Gregory <[hidden email]>
> wrote:
> >
> > > Are there any open issues we want to address for 4.3 is the SNAPSHOT OK
> > as
> > > is?
> > >
> > > Gary
> > >
> > > On Mon, Oct 15, 2018 at 10:42 AM Maxim Solodovnik <
> [hidden email]>
> > > wrote:
> > >
> > > > Hello Benedikt,
> > > >
> > > > I would like to remind you about 4.3 release :)
> > > >
> > > > On Tue, 25 Sep 2018 at 20:45, Maxim Solodovnik <[hidden email]
> >
> > > > wrote:
> > > > >
> > > > > Great,
> > > > >
> > > > > Thanks a million!
> > > > >
> > > > > On Tue, 25 Sep 2018 at 20:39, Benedikt Ritter <[hidden email]>
> > > > wrote:
> > > > >>
> > > > >> Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
> > > > >> [hidden email]>:
> > > > >>
> > > > >> > Hello Maxim,
> > > > >> > Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
> > > > >> > [hidden email]>:
> > > > >> >
> > > > >> >> 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
> > > > >>
> > > > >>
> > > > >> >
> > > > >> >
> > > > >> >>
> > > > >> >> 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
> > > > >> >
> > > > >> >
> > > > >> >>
> > > > >> >>
> > > > >> >>
> > > > >> >> On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <
> > > [hidden email]
> > > > >
> > > > >> >> wrote:
> > > > >> >>
> > > > >> >> > One more question: it seems there is no 4.3-SNAPSHOT build
> > > > available
> > > > >> >> > Could you please create it?
> > > > >> >> >
> > > > >> >> > On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <
> > > > [hidden email]>
> > > > >> >> > wrote:
> > > > >> >> > >
> > > > >> >> > > 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 <
> > > > [hidden email]>
> > > > >> >> > wrote:
> > > > >> >> > > >
> > > > >> >> > > > 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 <
> > > > >> >> [hidden email]
> > > > >> >> > >
> > > > >> >> > > > wrote:
> > > > >> >> > > >
> > > > >> >> > > > > 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 <
> > > > [hidden email]
> > > > >> >> >
> > > > >> >> > wrote:
> > > > >> >> > > > > >
> > > > >> >> > > > > > 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
> > > > >> >> > > > > >
> > > > >> >> > > > > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
> > > > >> >> > [hidden email]>
> > > > >> >> > > > > > wrote:
> > > > >> >> > > > > >
> > > > >> >> > > > > > > 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;
> > > > >> >> > > > > > > +    }
> > > > >> >> > > > > > >  }
> > > > >> >> > > > > > >
> > > > >> >> > > > > > >
> > > > >> >> > > > > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
> > > > >> >> > [hidden email]>
> > > > >> >> > > > > > > wrote:
> > > > >> >> > > > > > >
> > > > >> >> > > > > > > > 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
> > > > >> >> > > > > > > > <[hidden email]> wrote:
> > > > >> >> > > > > > > > >
> > > > >> >> > > > > > > > > What is realy your problem??..
> > > > >> >> > > > > > > > >
> > > > >> >> > > > > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim Solodovnik <
> > > > >> >> > > > > [hidden email]>
> > > > >> >> > > > > > > > wrote:
> > > > >> >> > > > > > > > >
> > > > >> >> > > > > > > > > > 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:
> > > > >> >> > [hidden email]
> > > > >> >> > > > > > > > > > For additional commands, e-mail:
> > > > >> >> > [hidden email]
> > > > >> >> > > > > > > > > >
> > > > >> >> > > > > > > > > >
> > > > >> >> > > > > > > >
> > > > >> >> > > > > > > >
> > > > >> >> > > > > > > >
> > > > >> >> > > > > > > > --
> > > > >> >> > > > > > > > WBR
> > > > >> >> > > > > > > > Maxim aka solomax
> > > > >> >> > > > > > > >
> > > > >> >> > > > > > >
> > > > >> >> > > > > > >
> > > > >> >> > > > > > > --
> > > > >> >> > > > > > > WBR
> > > > >> >> > > > > > > Maxim aka solomax
> > > > >> >> > > > > > >
> > > > >> >> > > > >
> > > > >> >> > > > >
> > > > >> >> > > > >
> > > > >> >> > > > > --
> > > > >> >> > > > > WBR
> > > > >> >> > > > > Maxim aka solomax
> > > > >> >> > > > >
> > > > >> >> > > > >
> > > > >> >>
> > > ---------------------------------------------------------------------
> > > > >> >> > > > > To unsubscribe, e-mail:
> > > [hidden email]
> > > > >> >> > > > > For additional commands, e-mail:
> > > > [hidden email]
> > > > >> >> > > > >
> > > > >> >> > > > >
> > > > >> >> > >
> > > > >> >> > >
> > > > >> >> > >
> > > > >> >> > > --
> > > > >> >> > > WBR
> > > > >> >> > > Maxim aka solomax
> > > > >> >> >
> > > > >> >> >
> > > > >> >> >
> > > > >> >> > --
> > > > >> >> > WBR
> > > > >> >> > Maxim aka solomax
> > > > >> >> >
> > > > >> >>
> > > > >> >>
> > > > >> >> --
> > > > >> >> WBR
> > > > >> >> Maxim aka solomax
> > > > >> >>
> > > > >> >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > WBR
> > > > > Maxim aka solomax
> > > >
> > > >
> > > >
> > > > --
> > > > WBR
> > > > Maxim aka solomax
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [hidden email]
> > > > For additional commands, e-mail: [hidden email]
> > > >
> > > >
> > >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>


--
WBR
Maxim aka solomax
Reply | Threaded
Open this post in threaded view
|

Re: Help with migrating one of OpenJPA classes to commons-collections4

garydgregory
I hope someone will take the time to do this over the US Thanksgiving
holidays perhaps.

Gary

On Mon, Nov 12, 2018, 22:37 Maxim Solodovnik <[hidden email] wrote:

> Hello Gary,
>
> we all are volunteers :)
> Why I'm asking: it will be blocker for OpenJPA release
>
> On Tue, 16 Oct 2018 at 19:39, Gary Gregory <[hidden email]> wrote:
>
> > 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
> >
> > On Mon, Oct 15, 2018, 22:23 Maxim Solodovnik <[hidden email]>
> wrote:
> >
> > > Hello Gary,
> > >
> > > SNAPSHOT works for us expected :)
> > > There is no rush, I just want to get some ETA :)
> > >
> > > On Tue, 16 Oct 2018 at 00:07, Gary Gregory <[hidden email]>
> > wrote:
> > >
> > > > Are there any open issues we want to address for 4.3 is the SNAPSHOT
> OK
> > > as
> > > > is?
> > > >
> > > > Gary
> > > >
> > > > On Mon, Oct 15, 2018 at 10:42 AM Maxim Solodovnik <
> > [hidden email]>
> > > > wrote:
> > > >
> > > > > Hello Benedikt,
> > > > >
> > > > > I would like to remind you about 4.3 release :)
> > > > >
> > > > > On Tue, 25 Sep 2018 at 20:45, Maxim Solodovnik <
> [hidden email]
> > >
> > > > > wrote:
> > > > > >
> > > > > > Great,
> > > > > >
> > > > > > Thanks a million!
> > > > > >
> > > > > > On Tue, 25 Sep 2018 at 20:39, Benedikt Ritter <
> [hidden email]>
> > > > > wrote:
> > > > > >>
> > > > > >> Am Di., 25. Sep. 2018 um 15:36 Uhr schrieb Benedikt Ritter <
> > > > > >> [hidden email]>:
> > > > > >>
> > > > > >> > Hello Maxim,
> > > > > >> > Am Mo., 24. Sep. 2018 um 05:32 Uhr schrieb Maxim Solodovnik <
> > > > > >> > [hidden email]>:
> > > > > >> >
> > > > > >> >> 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
> > > > > >>
> > > > > >>
> > > > > >> >
> > > > > >> >
> > > > > >> >>
> > > > > >> >> 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
> > > > > >> >
> > > > > >> >
> > > > > >> >>
> > > > > >> >>
> > > > > >> >>
> > > > > >> >> On Thu, 20 Sep 2018 at 17:58, Maxim Solodovnik <
> > > > [hidden email]
> > > > > >
> > > > > >> >> wrote:
> > > > > >> >>
> > > > > >> >> > One more question: it seems there is no 4.3-SNAPSHOT build
> > > > > available
> > > > > >> >> > Could you please create it?
> > > > > >> >> >
> > > > > >> >> > On Thu, 20 Sep 2018 at 12:47, Maxim Solodovnik <
> > > > > [hidden email]>
> > > > > >> >> > wrote:
> > > > > >> >> > >
> > > > > >> >> > > 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 <
> > > > > [hidden email]>
> > > > > >> >> > wrote:
> > > > > >> >> > > >
> > > > > >> >> > > > 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 <
> > > > > >> >> [hidden email]
> > > > > >> >> > >
> > > > > >> >> > > > wrote:
> > > > > >> >> > > >
> > > > > >> >> > > > > 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 <
> > > > > [hidden email]
> > > > > >> >> >
> > > > > >> >> > wrote:
> > > > > >> >> > > > > >
> > > > > >> >> > > > > > 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
> > > > > >> >> > > > > >
> > > > > >> >> > > > > > On Wed, Sep 5, 2018 at 10:12 AM Maxim Solodovnik <
> > > > > >> >> > [hidden email]>
> > > > > >> >> > > > > > wrote:
> > > > > >> >> > > > > >
> > > > > >> >> > > > > > > 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;
> > > > > >> >> > > > > > > +    }
> > > > > >> >> > > > > > >  }
> > > > > >> >> > > > > > >
> > > > > >> >> > > > > > >
> > > > > >> >> > > > > > > On Mon, 3 Sep 2018 at 20:08, Maxim Solodovnik <
> > > > > >> >> > [hidden email]>
> > > > > >> >> > > > > > > wrote:
> > > > > >> >> > > > > > >
> > > > > >> >> > > > > > > > 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
> > > > > >> >> > > > > > > > <[hidden email]> wrote:
> > > > > >> >> > > > > > > > >
> > > > > >> >> > > > > > > > > What is realy your problem??..
> > > > > >> >> > > > > > > > >
> > > > > >> >> > > > > > > > > On Sat, Sep 1, 2018, 5:46 AM Maxim
> Solodovnik <
> > > > > >> >> > > > > [hidden email]>
> > > > > >> >> > > > > > > > wrote:
> > > > > >> >> > > > > > > > >
> > > > > >> >> > > > > > > > > > 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:
> > > > > >> >> > [hidden email]
> > > > > >> >> > > > > > > > > > For additional commands, e-mail:
> > > > > >> >> > [hidden email]
> > > > > >> >> > > > > > > > > >
> > > > > >> >> > > > > > > > > >
> > > > > >> >> > > > > > > >
> > > > > >> >> > > > > > > >
> > > > > >> >> > > > > > > >
> > > > > >> >> > > > > > > > --
> > > > > >> >> > > > > > > > WBR
> > > > > >> >> > > > > > > > Maxim aka solomax
> > > > > >> >> > > > > > > >
> > > > > >> >> > > > > > >
> > > > > >> >> > > > > > >
> > > > > >> >> > > > > > > --
> > > > > >> >> > > > > > > WBR
> > > > > >> >> > > > > > > Maxim aka solomax
> > > > > >> >> > > > > > >
> > > > > >> >> > > > >
> > > > > >> >> > > > >
> > > > > >> >> > > > >
> > > > > >> >> > > > > --
> > > > > >> >> > > > > WBR
> > > > > >> >> > > > > Maxim aka solomax
> > > > > >> >> > > > >
> > > > > >> >> > > > >
> > > > > >> >>
> > > > ---------------------------------------------------------------------
> > > > > >> >> > > > > To unsubscribe, e-mail:
> > > > [hidden email]
> > > > > >> >> > > > > For additional commands, e-mail:
> > > > > [hidden email]
> > > > > >> >> > > > >
> > > > > >> >> > > > >
> > > > > >> >> > >
> > > > > >> >> > >
> > > > > >> >> > >
> > > > > >> >> > > --
> > > > > >> >> > > WBR
> > > > > >> >> > > Maxim aka solomax
> > > > > >> >> >
> > > > > >> >> >
> > > > > >> >> >
> > > > > >> >> > --
> > > > > >> >> > WBR
> > > > > >> >> > Maxim aka solomax
> > > > > >> >> >
> > > > > >> >>
> > > > > >> >>
> > > > > >> >> --
> > > > > >> >> WBR
> > > > > >> >> Maxim aka solomax
> > > > > >> >>
> > > > > >> >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > WBR
> > > > > > Maxim aka solomax
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > WBR
> > > > > Maxim aka solomax
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: [hidden email]
> > > > > For additional commands, e-mail: [hidden email]
> > > > >
> > > > >
> > > >
> > >
> > >
> > > --
> > > WBR
> > > Maxim aka solomax
> > >
> >
>
>
> --
> WBR
> Maxim aka solomax
>
12