[hibernate-dev] HSEARCH-1084 build failed
Emmanuel Bernard
emmanuel at hibernate.org
Tue Apr 24 18:17:47 EDT 2012
Sanne caught that one recently but your bisect helped a lot.
It seems that we are a bit optimistic with out generic Russian dolls
http://stackoverflow.com/questions/2431334/java-generics-what-is-the-compilers-issue-here-no-unique-maximal-instance
/**
* Creates the proxy for an annotation using Hibernate Commons Annotations
* @param annotation the AnnotationDescriptor
* @return the proxy
*/
private static <T extends Annotation> T createAnnotation(AnnotationDescriptor annotation) {
//This is a filthy workaround for the Annotations proxy generation,
//which is using the ContextClassLoader to define the proxy classes
//(not working fine in modular environments when Search is used by
//other services such as CapeDwarf).
//See HSEARCH-1084
//use annotation's own classloader
try {
return AnnotationFactory.create( annotation, annotation.type().getClassLoader() );
}
catch ( Exception e ) {
//first try, but we have another trick
}
//Use TCCL
return org.hibernate.annotations.common.annotationfactory.AnnotationFactory.create( annotation );
}
Basically the compiler cannot guarantee that T in the outer method is the same as T in the AnnotationFactory.create methods. Unfortunately it yells in some strange language.
It looks like the compiler is a bit more stupid on Windows for some obscure reason. Could you try 1.6.0_31 (the latest)?
On 24 avr. 2012, at 23:48, Nicolas Helleringer wrote:
> Hi all,
>
> Fetching last master tonight I was not able to build :
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
> (default-compile) on project hibernate-search-engine: Compilation failure:
> Compilation failure:
> [ERROR]
> \hibernate-search\hibernate-search-engine\src\main\java\org\hibernate\search\impl\MappingModelMetadataProvider.java:[251,34]
> type parameters of <T>T cannot be determined; no unique maximal instance
> exists for type variable T with upper bounds
> T,java.lang.annotation.Annotation
> [ERROR]
> \hibernate-search\hibernate-search-engine\src\main\java\org\hibernate\search\impl\MappingModelMetadataProvider.java:[257,84]
> type parameters of <T>T cannot be determined; no unique maximal instance
> exists for type variable T with upper bounds
> T,java.lang.annotation.Annotation
>
> After a goo bisect it seems 31b485c1aaabd9b0ff178505067147e5628e3010 is the
> first bad commit.
>
> It is HSEARCH-1084 Annotation proxies created by Programmatic Mapping
>
> I m still on windows 7 x64 with 1.6.0_24 jvm
>
> Hope it helps.
>
> Niko
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
More information about the hibernate-dev
mailing list