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

On gradle projects in Eclipse StringIndexOutOfBoundException from spring-boot annotation processor #2361

Closed
kdvolder opened this Issue Jan 15, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@kdvolder
Member

kdvolder commented Jan 15, 2015

The reason appears to be that an assumption is made that project output folder must end with the word 'classes' but this is not the case. Output folders in Eclipse are configurable to different locations and in Gradle projects they used the 'default' which is a folder in the project called 'bin'.

!ENTRY org.eclipse.jdt.apt.pluggable.core 1 1 2015-01-14 17:09:12.352
!MESSAGE java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1954)
    at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.getAdditionalMetadata(ConfigurationMetadataAnnotationProcessor.java:484)
    at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.mergeAdditionalMetadata(ConfigurationMetadataAnnotationProcessor.java:442)
    at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.writeMetaData(ConfigurationMetadataAnnotationProcessor.java:379)
    at org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor.process(ConfigurationMetadataAnnotationProcessor.java:178)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:110)
    at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
    at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:134)
    at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:855)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:434)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:367)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:179)
    at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:304)
    at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:61)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:256)
    at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:186)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

@kdvolder kdvolder self-assigned this Jan 15, 2015

@philwebb philwebb added this to the 1.2.2 milestone Jan 15, 2015

@philwebb philwebb added tools and removed tools labels Jan 15, 2015

kdvolder added a commit to kdvolder/spring-boot that referenced this issue Jan 15, 2015

@kdvolder kdvolder referenced this issue Jan 15, 2015

Closed

Fixes gh-2361 #2369

kdvolder added a commit that referenced this issue Jan 21, 2015

Remove incorrect assumption that output will be in folder named classes
When running in Eclipse, by default Gradle builds its output into a
folder named bin. This commit update the annotation processor to remove
the failure assumption that the output will always be located beneath
a folder named classes.

Closes gh-2369
See gh-2361

wilkinsona added a commit that referenced this issue Jan 21, 2015

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