Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] Eclipse Juno JDT Compiler error

First off thanks for all our hard work on eclipse.  It really is a great IDE!

I've been experiencing several problems with the eclipse juno jdt compiler.  First, I've run into  http://stackoverflow.com/questions/11323415/is-eclipse-juno-wrong-with-this-ambiguous-method-error which is actually no big deal and is not eclipse's fault.

The second error which I cannot figure out how to resolve deals with generics and annotations.

We have the following class which is a jaxb adapter:

public class AttributeSetAdapter extends XmlAdapter<StringMapEntry[], AttributeSet> {
    @Override public StringMapEntry[] marshal(AttributeSet attributeSet) throws Exception {...snip...}
    @Override public AttributeSet unmarshal(StringMapEntry[] entryArray) throws Exception { ...snip...}
}

The XmlAdapter class has the following signature:

public abstract class XmlAdapter<ValueType,BoundType> {
    protected XmlAdapter() {}
    public abstract BoundType unmarshal(ValueType v) throws Exception;
    public abstract ValueType marshal(BoundType v) throws Exception;
}

We refer to the AttributeSetAdapter.class token in an annotation in an interface method like the following:

boolean hasPermission(
  @WebParam(name = "principalId") String principalId,
  @WebParam(name = "namespaceCode") String namespaceCode,
  @WebParam(name = "permissionName") String permissionName,
  @WebParam(name = "permissionDetails") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet permissionDetails);


The @ XmlJavaTypeAdapter annotation has the following signature:

@Retention(RUNTIME) @Target({PACKAGE,FIELD,METHOD,TYPE,PARAMETER})        
public @interface XmlJavaTypeAdapter {
    Class<? extends XmlAdapter> value();
    Class type() default DEFAULT.class;
    static final class DEFAULT {}
}


eclipse gives the following error:

Description Resource Path Location Type
Type mismatch: cannot convert from Class<AttributeSetAdapter> to Class<? extends XmlAdapter> IdentityManagementService.java /kfs-rice-1.0.3.1/api/src/main/java/org/kuali/rice/kim/service line 203 Java Problem

I'm using eclipse 4.2 Juno EE edition 64 bit.  I've tried compiling the project using java 1.6 & 1.7 compatibility.  This project compiles fine using older versions of eclipse and on the command line via maven.  I've tried all kinds of tweaks to the source code and different compiler settings.  Sometimes the error goes away but as soon as I do a clean the errors come back.

I was hoping somebody might have a workaround for this.  Also, I checked bugzilla but I wasn't sure if the open bugs I found were related to this.

This projects is available @ https://svn.kuali.org/repos/rice/tags/rice-1.0.3.1/

If you need any other information or test cases or anything else I'll gladly help out.

Thanks a lot!

~Travis





Back to the top