Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PatternSyntaxException encountered on Windows #1

Closed
rentallect opened this issue Aug 11, 2015 · 5 comments
Closed

PatternSyntaxException encountered on Windows #1

rentallect opened this issue Aug 11, 2015 · 5 comments

Comments

@rentallect
Copy link

Sean,

I do most of my dev on a Mac, but am trying to use your nifty plugin on a Windows box, and I'm getting the following error:

Caused by: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1

^
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.lang.String.split(Unknown Source)
at java.lang.String.split(Unknown Source)
at com.github.seanroy.plugins.LambduhMojo.execute(LambduhMojo.java:98)
...

I think this can be resolved by changing line 98 of your code from:

String[] pieces = functionCode.split(File.separator);

to this:

String[] pieces = functionCode.split(File.separatorChar);

@SeanRoy
Copy link
Owner

SeanRoy commented Aug 11, 2015

OK, thanks for the comment, I'll look into this as soon as I can.

@SeanRoy
Copy link
Owner

SeanRoy commented Aug 11, 2015

The problem is that the file separator on windows is a backslash, which needs to be quoted. I believe I resolved the problem by using Pattern.quote(File.separator).

I just deployed this so please look for version 1.0.2. It can take an hour or two before it's available in the maven central repository.

@rentallect
Copy link
Author

Will do. Thanks.
On Aug 11, 2015 12:51 PM, "Sean Roy" notifications@github.com wrote:

The problem is that the file separator on windows is a backslash, which
needs to be quoted. I believe I resolved the problem by using
Pattern.quote(File.separator).

I just deployed this so please look for version 1.0.2. It can take an hour
or two before it's available in the maven central repository.


Reply to this email directly or view it on GitHub
#1 (comment)
.

@SeanRoy
Copy link
Owner

SeanRoy commented Aug 12, 2015

Did this solve your problem? Let me know so I can close this issue, thanks!

@SeanRoy SeanRoy closed this as completed Aug 13, 2015
@rentallect
Copy link
Author

Sorry for delay. Yes, the update is working fine. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants