AlabLan opened a new issue, #523:
URL: https://github.com/apache/casbin-jcasbin/issues/523

   I followed the documentation at https://casbin.apache.org/docs/function and 
tried to use the keyGet3 function, but discovered that the Java implementation 
of casbin does not have this function.
   
     After checking the source code, I confirmed that jcasbin only has keyGet 
and keyGet2 (using `:var` style), but is missing keyGet3 (using `{var}` style) 
which exists in the Go version.
   
     I ported the keyGet3 function from the Go version following the existing 
code style of keyGet and keyGet2. However, during implementation, I encountered 
a regex incompatibility issue between Go and Java
     where certain valid Go test patterns cause regex compilation errors in 
Java.
   
     Specifically, patterns like "/{id/using/{resId}" work in Go but fail in 
Java because Java treats "{" as a repetition quantifier modifier, causing 
"/{id/using/(" to be interpreted as an invalid quantifier
     pattern.
   
     I added extra logic to escape remaining `{` and `}` characters after 
replacement to maintain compatibility with Go's behavior.
   
   Fixes #522


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to