ceylon-ide-eclipse
ceylon-ide-eclipse copied to clipboard
Service provider is lost when renamed
steps to reproduce:
1. Code:
shared interface A {}
service(`interface A`)
shared class C() satisfies A {}
shared void run() {
print(`module`.findServiceProviders(`A`));
}
2. Run
everything is OK
3. Rename C
to C1
so code looks like:
shared interface A {}
service(`interface A`)
shared class C1() satisfies A {}
shared void run() {
print(`module`.findServiceProviders(`A`));
}
4. Run
Exception is thrown. Looks like service provider with old name C
is searched instead of new one C1
.
stack trace:
Exception in thread "main" java.util.ServiceConfigurationError: herd.test.schedule.chime.A: Provider herd.test.schedule.chime.C not found
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at com.redhat.ceylon.compiler.java.runtime.metamodel.decl.ModuleImpl$1It$1.next(ModuleImpl.java:243)
at ceylon.language.ChainedIterator.next(ChainedIterator.ceylon:14)
at ceylon.language.Iterable$impl$4$1.elem(Iterable.ceylon:468)
at ceylon.language.Iterable$impl$4$1.$next$1(Iterable.ceylon:468)
at ceylon.language.Iterable$impl$4$1.next(Iterable.ceylon:468)
at com.redhat.ceylon.compiler.java.language.ConstantIterable$1.next(ConstantIterable.java:51)
at ceylon.language.Iterable$impl$1anonymous_10_$1anonymous_11_.next(Iterable.ceylon:1053)
at ceylon.language.Array.createArrayFromIterable(Array.java:164)
at ceylon.language.Array.
@davidfestal could you take a look at this one please, or at least let me know where to look? Thanks
@lisilisenok the workaround is to do a clean build, I suppose, right?
@gavinking right, clean build helps