Re: Incompatible types Java compiler error

270 views
Skip to first unread message

swillcox

unread,
Aug 13, 2012, 5:11:25 PM8/13/12
to ne...@googlegroups.com
More info:

neo4j.jar 1.7.2

The compilation error happens on existing application code that does compile ok when the neo jar is not in the classpath.

Here's the code that does not compile with this jar in the classpath:

import org.springframework.beans.factory.annotation.Qualifier;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Qualifier
public @interface RequestTracking {
    String value() default RequestTrackingContext.QUALIFIER;
}

On Monday, August 13, 2012 2:49:40 PM UTC-6, swillcox wrote:
When I include neo4j-kernel.jar in my classpath I get the following java compiler error:

RequestTracking.java:14: incompatible types
found   : java.lang.String
required: java.lang.String
    String value() default RequestTrackingContext.QUALIFIER;

After removing the jar, all is well - no errors.

Using java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)

Anyone have an idea what's going on here?

Thanks

Steve


Michael Hunger

unread,
Aug 13, 2012, 6:32:03 PM8/13/12
to ne...@googlegroups.com
Try to fully qualify the enum with package, that's imho a known compiler bug.


    String value() default com.example.....RequestTrackingContext.QUALIFIER;

swillcox

unread,
Aug 14, 2012, 10:29:13 AM8/14/12
to ne...@googlegroups.com
Awesome! That fixed it. Thank you.

Steve
Reply all
Reply to author
Forward
0 new messages