directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Seelmann <seelm...@apache.org>
Subject [Studio] Build problem with List cast
Date Sun, 18 Nov 2007 20:48:57 GMT
Hi Dev,

in Studio we have the following line of code:

configuration.setSupportedMechanisms( new ArrayList<String>( ( List<?
extends String> ) Arrays.asList(
supportedMechanismsTableViewer.getCheckedElements() ) ) );

The method configuration.setSupportedMechanisms expects an List<String>
parameter. The "supportedMechanismsTableViewer.getCheckedElements()"
returns an Object[].

Inside of eclipse this line is just marked with a warning: "Type safety:
Unchecked cast from List<Object> to List<? extends String>"


But when building from command line using ant I get the following error:

    [javac]
/home/stefan/Documents/Apache/svn/studio/trunk2/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/GeneralPage.java:878:
inconvertible types
    [javac] found   : java.util.List<java.lang.Object>
    [javac] required: java.util.List<? extends java.lang.String>
    [javac]             .asList(
supportedMechanismsTableViewer.getCheckedElements() ) ) );


The odd thing is if I just touch the java file (adding a space
somewhere) the compilation works!


Any idea what may be the problem here?


Here is the class:
http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/GeneralPage.java?view=markup&pathrev=596110

Regards,
Stefan

Mime
View raw message