RFR JDK-8194667: Regex: Serialization doesn't work with match flags

Roger Riggs Roger.Riggs at Oracle.com
Fri Jan 12 18:22:43 UTC 2018


Hi Sherman,

flag0 javadoc:

/**
  957      * The pattern flags used during compiling. The flags might be turn*ed*  on and
  958      * off by*an *embedded flag.
  959      */

2946-3047: Can an exception happen between save and restore? Would the 
value of flag0 matter if so?

+Copyright year update

Regards, Roger

On 1/12/2018 11:48 AM, Xueming Shen wrote:
> Hi,
>
> Please help review the change for JDK-8194667
>
> issue: https://bugs.openjdk.java.net/browse/JDK-8194667
> webrev: http://cr.openjdk.java.net/~sherman/8194667/webrev
>
> The bits of "flags" are being updated on and off during the pattern 
> compiling by
> the possible embedded match flag(s) in old implementation. The 
> proposed fix is
> to add a temporary field "flags0" for this purpose and save/store 
> "flags" for the
> purpose of deserialization (same as the field "pattern").
>
> For the compatibility concern I'm leaving the behavior of method 
> flags() unchanged
> to return the muted "flags". Arguably it might be desired to return 
> the original "flags"
> instead. We can leave this "issue" for future RFE.
>
> 1145     public int flags() {
> 1146         return flags0;
> 1147     }
>
>
> Thanks,
> Sherman



More information about the core-libs-dev mailing list