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

java.util.regex.PatternSyntaxException when generating a project using a template that used to work #451

Closed
magneticflux- opened this issue Dec 29, 2019 · 1 comment · Fixed by #452

Comments

@magneticflux-
Copy link
Contributor

steps

Giter8 version: 0.12.0
Java version: 1.8.0_221

problem

The format might have changed slightly and invalidated something I was using before. I can't tell where I need to adjust it though because the error message doesn't specify the file being used.

stack trace
[info] resolving Giter8 0.12.0...
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR [java.net.URLClassLoader@56afaa] whereas object of type
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by [java.net.URLClassLoader@14c265e].
log4j:ERROR Could not instantiate appender named "stderr".
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.<init>(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 giter8.G8$.expandPath(g8.scala:212)
        at giter8.G8$.$anonfun$writeTemplates$1(g8.scala:488)
        at scala.collection.immutable.Stream.map(Stream.scala:418)
        at giter8.G8$.writeTemplates(g8.scala:486)
        at giter8.G8$.$anonfun$applyT$1(g8.scala:347)
        at scala.util.Either$RightProjection.flatMap(Either.scala:701)
        at giter8.G8$.applyT(g8.scala:330)
        at giter8.G8$.fromDirectory(g8.scala:76)
        at giter8.G8TemplateRenderer$.render(TemplateRenderer.scala:40)
        at giter8.AppProcessor.process(giter8.scala:58)
        at giter8.Runner.$anonfun$run$9(Runner.scala:54)
        at scala.util.Either.flatMap(Either.scala:341)
        at giter8.Runner.$anonfun$run$5(Runner.scala:51)
        at scala.util.Either.flatMap(Either.scala:341)
        at giter8.Runner.$anonfun$run$4(Runner.scala:50)
        at scala.util.Either.flatMap(Either.scala:341)
        at giter8.Runner.run(Runner.scala:49)
        at giter8.Giter8.run(giter8.scala:33)
        at giter8.Giter8.run(giter8.scala:30)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at giter8.LauncherProcessor.call(LauncherMain.scala:113)
        at giter8.LauncherProcessor.virtuallyRun(LauncherMain.scala:87)
        at giter8.LauncherProcessor.process(LauncherMain.scala:38)
        at giter8.Runner.$anonfun$run$9(Runner.scala:54)
        at scala.util.Either.flatMap(Either.scala:341)
        at giter8.Runner.$anonfun$run$5(Runner.scala:51)
        at scala.util.Either.flatMap(Either.scala:341)
        at giter8.Runner.$anonfun$run$4(Runner.scala:50)
        at scala.util.Either.flatMap(Either.scala:341)
        at giter8.Runner.run(Runner.scala:49)
        at giter8.Runner.run(Runner.scala:75)
        at giter8.LauncherMain$.delayedEndpoint$giter8$LauncherMain$1(LauncherMain.scala:12)
        at giter8.LauncherMain$delayedInit$body.apply(LauncherMain.scala:9)
        at scala.Function0.apply$mcV$sp(Function0.scala:39)
        at scala.Function0.apply$mcV$sp$(Function0.scala:39)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
        at scala.App.$anonfun$main$1$adapted(App.scala:80)
        at scala.collection.immutable.List.foreach(List.scala:392)
        at scala.App.main(App.scala:80)
        at scala.App.main$(App.scala:78)
        at giter8.LauncherMain$.main(LauncherMain.scala:9)
        at giter8.LauncherMain.main(LauncherMain.scala)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at coursier.bootstrap.launcher.a.a(Unknown Source)
        at coursier.bootstrap.launcher.Launcher.main(Unknown Source)

expectation

It should have worked or at least given me a lead to go on with the error message.

notes

@magneticflux-
Copy link
Contributor Author

magneticflux- commented Dec 29, 2019

Here's the line that causes the issue I think:

.split(fileSeparator)

The fileSeparator is actually a string, not a character, so it calls the regex version of the split function.

Edit: Since it's actually an internal error, the error message not including the file being processed isn't really an issue.

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

Successfully merging a pull request may close this issue.

1 participant