Hi Folks

I just wanted to be sure that im not somekind of stuipid or so
I have the following lines of code

    private static final ArrayList<Class<? extends SchemaElement>> tabItems
= new ArrayList<Class<? extends SchemaElement>>();

    static{
        tabItems.addAll((Collection<? extends Class<? extends
SchemaElement>>)
                Arrays.asList(new Class[]{BuildProfile.class}));
    }

Well it seems to compile ok with the regular java 1.6 compiler.

I am trying the same trough maven with the following compiler conifguration

               <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.0.2</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                    </configuration>
                </plugin>

well the error is that it is of a *inconvertible types*

i had to change it to

    private static final ArrayList<Class> tabItems = new ArrayList<Class>();

    static{
        tabItems.addAll((Collection<Class>) Arrays.asList(new
Class[]{BuildProfile.class}));
    }

to make it compile.

Any ideas why that ?


Thanks in advance.
Roman

Reply via email to