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

StringIndexOutOfBoundsException #52

Closed
loredan opened this issue Jul 13, 2014 · 4 comments
Closed

StringIndexOutOfBoundsException #52

loredan opened this issue Jul 13, 2014 · 4 comments
Assignees
Milestone

Comments

@loredan
Copy link

loredan commented Jul 13, 2014

String index out of range: 1: String index out of range: 1
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
    at java.lang.String.charAt(String.java:658)
    at java.util.regex.Matcher.appendReplacement(Matcher.java:762)
    at java.util.regex.Matcher.replaceAll(Matcher.java:906)
    at java.lang.String.replaceAll(String.java:2162)
    at protobuf.compiler.PbGenerationItem.getValidityState(PbGenerationItem.java:77)
    at protobuf.compiler.PbCompiler.generate(PbCompiler.java:140)
    at protobuf.compiler.PbPrecompileTask.execute(PbPrecompileTask.java:32)
    at com.intellij.compiler.impl.CompileDriver.executeCompileTasks(CompileDriver.java:2379)
    at com.intellij.compiler.impl.CompileDriver.access$900(CompileDriver.java:122)
    at com.intellij.compiler.impl.CompileDriver$8.run(CompileDriver.java:710)
    at com.intellij.compiler.progress.CompilerTask.run(CompilerTask.java:167)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:471)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$8.run(ProgressManagerImpl.java:380)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)

Problem started occuring after update to 0.5.6. What's interesting that IntelliJ IDEA says that compilation completed succesfully, but runs older version of project.

@loredan
Copy link
Author

loredan commented Jul 13, 2014

Running an IntelliJ IDEA Community Edition 13.1.3

@tcripps tcripps self-assigned this Jul 14, 2014
@tcripps
Copy link
Collaborator

tcripps commented Jul 14, 2014

Thanks. Can you please let me know the Java package names of the files you generate?

The code is trying to find the destination of the generated Java file:

final String sep = System.getProperty("file.separator");
final String safePackageName = packageName.length() > 0 ? packageName.replaceAll(".", sep) : packageName;

@loredan
Copy link
Author

loredan commented Jul 14, 2014

It's com.technoworks.fusionmonitor I think. The code itself is here: https://github.com/it-workshop/FusionMonitor

@tcripps
Copy link
Collaborator

tcripps commented Jul 14, 2014

Thanks!

@tcripps tcripps added this to the v.0.5.7 milestone Jul 14, 2014
tcripps pushed a commit that referenced this issue Jul 14, 2014
Fix a potential string replacement error. This code doesn't need regex behavior so changing it to use string.replace().
@tcripps tcripps closed this as completed Jul 14, 2014
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