java.util.regex.PatternSyntaxException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • String.split() : Runtime Error in program !
    via by Rahul Sudip Bose,
  • GitHub comment 75#3382290
    via GitHub by hseeberger
    ,
  • After adding a test project to my repository, I started getting the below error during the build when updating android project files. 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 hudson.plugins.android_emulator.util.Utils.getRelativePath(Utils.java:616) at hudson.plugins.android_emulator.util.Utils.getRelativePathDistance(Utils.java:665) at hudson.plugins.android_emulator.builder.UpdateProjectBuilder.perform(UpdateProjectBuilder.java:130) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1593) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247) I tracked down the error which appears to be a misuse of the String.split function in plugins/android_emulator/util/Utils.java:616. // Target directory is somewhere above our directory String[] fromParts = fromPath.substring(1).split(File.separator); final int fromLength = fromParts.length; String[] toParts = toPath.substring(1).split(File.separator); final int toLength = toParts.length; File.separator is a string but String.split is expecting a regex. On windows, File.separator is an invalid regex.
    via by Ryan Reading,
  • After adding a test project to my repository, I started getting the below error during the build when updating android project files. 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 hudson.plugins.android_emulator.util.Utils.getRelativePath(Utils.java:616) at hudson.plugins.android_emulator.util.Utils.getRelativePathDistance(Utils.java:665) at hudson.plugins.android_emulator.builder.UpdateProjectBuilder.perform(UpdateProjectBuilder.java:130) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) at hudson.model.Run.execute(Run.java:1593) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247) I tracked down the error which appears to be a misuse of the String.split function in plugins/android_emulator/util/Utils.java:616. // Target directory is somewhere above our directory String[] fromParts = fromPath.substring(1).split(File.separator); final int fromLength = fromParts.length; String[] toParts = toPath.substring(1).split(File.separator); final int toLength = toParts.length; File.separator is a string but String.split is expecting a regex. On windows, File.separator is an invalid regex.
    via by Ryan Reading,
    • 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 splitter.main(splitter.java:7)

    Users with the same issue

    bpbhat77
    1 times, last one,
    Juraji
    1 times, last one,
    Casper
    2 times, last one,
    Unknown visitor1 times, last one,
    Cafecanudo
    2 times, last one,
    22 more bugmates