Compiler error: incompatible types

When I try to compile this code it gives the error "incompatible types".
import java.util.ArrayList;
public class Poly {
     public static void main (String args[]) {
          Number integer = new Integer(1);
          ArrayList<Number> integers = new ArrayList<Integer>();
}Assigning a Number object an Integer which extends Number works fine.
But when I try to assign an ArrayList<Number> object an ArrayList<Integer> object it gives an imcompatible types error.
Shouldn't it work?
Edited by: aexyl93 on Jun 7, 2010 2:00 AM
Edited by: aexyl93 on Jun 7, 2010 2:05 AM

aexyl93 wrote:
Thanks for the quick replies.
I've never seen ArrayList<? extends obj> before.Nitpick: it's not "? extends obj" it's "? extends SomeClass".
"obj" kind of implies that you could use a variable/field here, which is wrong.
I thought it would be able to hold an object which extends what it's supposed to hold.A List<? extends Number> could contain any class that extends Number (as well as Number itself if it weren't an abstract class). However you can't add anything (except null), because you don't know the concrete type at this point.

Similar Messages

  • Studio 12.3 C compiler: internal compiler error: vector type in ty_build_co

    Trying to compile libspeex, the C compiler errors out with:
    cc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -I.. -I/usr/pkg/include -xO3 -m64 -xarch=native -xdepend -xvector -xtrigraphs -xannotate=no -w -features=no%conststrings,extensions -xc99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -c vq.c -KPIC -DPIC -o vq.o
    "vq_sse.h", line 37: internal compiler error: vector type in ty_build_composite()
    cc: acomp failed for vq.c
    The only way I was able to get it to compile was to remove -x03 -xarch=native -xvector completely (all three had to be removed):
    cc -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -I.. -I/usr/pkg/include -m64 -xdepend -xtrigraphs -xannotate=no -w -features=no%conststrings,extensions -xc99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -c vq.c -KPIC -DPIC -o vq.o

    It looks like you have run into bug 15757788, which has been fixed internally but does not seem to have been released in a patch yet. The bug report does not list a workaround.
    If you have a support contract, you can view the status of the bug at My Oracle Support, and you can check periodically for the next patch. You can also file a request to be notified when a patch is available, and possibly get a pre-release patch to test.

  • Warning: Compiler errors during type creation

    Hello all,
    when I run the following little script in my Oracle 8.1.7 SQL plus spreadsheet I get the following error message:
    "Warning: Compiler errors during type creation". (This is my offhand translation from German, since I have a German version)
    There is no further hint as to what the nature of the error is or how I can fix it, but for sure I can't use the type I tried to define.
    Can anybody help?
    Here is the code:
    set serveroutput on ;
    create or replace type DataPoint as object(
    name varchar2(20)
    create or replace type DataPointList as table of DataPoint ;
    create or replace type ElementType as object (
    TypeName varchar(20),
    Datapoints DataPointList
    create or replace type ElementList as table of ElementType ;
    Regards,
    Norbert Ploett
    null

    create or replace type DataPoint as object(
    name varchar2(20)
    create table DataPointList of DataPoint ;
    create or replace type ElementType as object (
    TypeName varchar(20),
    Datapoints DataPointList
    create table ElementList of ElementType ;
    This should work in the given case
    Ravi
    Regards,
    Norbert Ploett
    Regards,
    Norbert Ploett
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Norbert.Ploett:
    Hello all,
    when I run the following little script in my Oracle 8.1.7 SQL plus spreadsheet I get the following error message:
    "Warning: Compiler errors during type creation". (This is my offhand translation from German, since I have a German version)
    There is no further hint as to what the nature of the error is or how I can fix it, but for sure I can't use the type I tried to define.
    Can anybody help?
    Here is the code:<HR></BLOCKQUOTE>
    null

  • JAXB compiler error : Complex Type Definition Representation Error

    Hi,
    I have a problem when I try to generate Java classes for the XML Digital Signature schema along with the XAdES extension. Apparently, we got an XML validation issue when the XAdES schema is parsed.
    Here is the xjc tool ouput :
    [ERROR] src-ct.1: Complex Type Definition Representation Error for type 'IdentifierType'.  When complexContent is used, the base type must be a complexType.
      line 33 of XAdES.xsd
    [ERROR] src-ct.1: Complex Type Definition Representation Error for type 'EncapsulatedPKIDataType'.  When complexContent is used, the base type must be a complexType.
      line 57 of XAdES.xsdNow these are the schema lines from XAdES.xsd that cause the problem :
    <xsd:complexType name="IdentifierType">
      <xsd:complexContent>
        <xsd:extension base="xsd:anyURI">
          <xsd:attribute name="Qualifier" type="QualifierType" use="optional"/>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="EncapsulatedPKIDataType">
      <xsd:complexContent>
        <xsd:extension base="xsd:base64Binary">
          <xsd:attribute name="Id" type="xsd:ID" use="optional"/>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>The most disturbing thing is that those two schemas I used (e.g. xmldsig-core-schema.xsd and XAdES.xsd) come directly from the W3C, so they should be fully compliant to the XML schema spec, shouldn't they ?
    Moreover, I tried to validate these two schemas with XML Spy 4.3 and the problem occurs in slightly different way. In fact, the <xsd:complexContent> tags are replaced silently by XML Spy with <xsd:simpleContent> tags in order to validate the schema. So XML Spy seems to have a problem too with these complex type definitions. Besides, if I replace the <xsd:complexContent> tags the same way as XML Spy does, and if I run again the JAXB compiler, it works fine...
    Does anyone have any knowledge about this issue ? I'd like very much to hear about anyone who has experienced or better solved the same kind of issue.
    By the way, here is the version of JAXB that I use :
    xjc version "1.0.2-b15-fcs"
    JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build 1.0.2-b15-fcs)Any help appreciated.
    Thanks,
    Gregory

    <xsd:extension base="xsd:anyURI">
    <xsd:extension base="xsd:base64Binary">
    The base attribute of the xs:extension elements shoule refer to a complexType.
    For example,
    <xs:complexType name="complexTypeA">
    </xs:complexType>
    <xsd:complexType name="IdentifierType">
    <xsd:complexContent>
    <xsd:extension base="complexTypeA">
    <xsd:attribute name="Qualifier" type="QualifierType" use="optional"/>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>

  • Effectv don't compile. error: conflicting types for 'trunc'

    hello all.
    i'm full newbie, so please, be kind
    I try to install effectv from AUR, but when i try to 'make' - i receive error:
    error: conflicting types for 'trunc'
    then i download sources and try to compile them - and again receive this error.
    Please advice, what should i do to correct this error?
    Thank you and sorry for my english.

    Please contact the author of the PKGBUILD to have it changed in the AUR. This fixes your issues:
    PKGBUILD
    # Contributor: Luiz Ribeiro <luizribeiro>
    pkgname=effectv
    pkgver=0.3.11
    pkgrel=1
    pkgdesc="EffecTV is a real-time video effector. You can watch TV or video through amazing effectors."
    url="http://effectv.sourceforge.net/"
    depends=('sdl')
    makedepends=('nasm')
    conflicts=()
    license=
    install=
    source=('http://jaist.dl.sourceforge.net/sourceforge/effectv/effectv-0.3.11.tar.gz'
    'gcc.patch' 'timedist.patch')
    md5sums=('71570b71009df0f1ff53e31de6f50cee')
    build() {
    cd $startdir/src/$pkgname-$pkgver
    patch -Np0 < $startdir/src/gcc.patch || return 1
    patch -Np0 < $startdir/src/timedist.patch || return 1
    sed -i -e 's_/usr/local_/usr_g' config.mk
    make || return 1
    mkdir -p $startdir/pkg/usr/bin
    mkdir -p $startdir/pkg/usr/man/man1
    make install INSTALL=/bin/install -c DESTDIR=$startdir/pkg || return 1
    gcc.patch : fixes compile problem
    --- utils.c.orig 2006-02-14 15:06:17.000000000 +0100
    +++ utils.c 2006-08-30 22:47:19.514145536 +0200
    @@ -26,7 +26,7 @@
    * HSI color system utilities
    -static int trunc(double f)
    +static int trunc_color(double f)
    int i;
    @@ -44,9 +44,9 @@
    Gv=1+S*sin(H);
    Bv=1+S*sin(H+2*M_PI/3);
    T=255.999*I/2;
    - *r=trunc(Rv*T);
    - *g=trunc(Gv*T);
    - *b=trunc(Bv*T);
    + *r=trunc_color(Rv*T);
    + *g=trunc_color(Gv*T);
    + *b=trunc_color(Bv*T);
    timedist.patch : fixes bug
    This is a quick fix for bugs of effectv-0.3.11. TimeDistortion has a border
    crossing bug and a buffer uninitializing bug.
    Index: effects/timedist.c
    ===================================================================
    --- effects/timedist.c (revision 478)
    +++ effects/timedist.c (working copy)
    @@ -27,7 +27,16 @@
    static int plane;
    static int *warptime[2];
    static int warptimeFrame;
    +static int bgIsSet;
    +static int setBackground(RGB32 *src)
    +{
    + image_bgset_y(src);
    + bgIsSet = 1;
    +
    + return 0;
    +}
    +
    effect *timeDistortionRegister(void)
    effect *entry;
    @@ -70,6 +79,7 @@
    plane = 0;
    image_set_threshold_y(MAGIC_THRESHOLD);
    + bgIsSet = 0;
    state = 1;
    return 0;
    @@ -94,6 +104,9 @@
    int *p, *q;
    memcpy(planetable[plane], src, PIXEL_SIZE * video_area);
    + if(!bgIsSet) {
    + setBackground(src);
    + }
    diff = image_bgsubtract_update_y(src);
    p = warptime[warptimeFrame ] + video_width + 1;
    @@ -109,7 +122,7 @@
    q += 2;
    - q = warptime[warptimeFrame ^ 1] + video_width + 1;
    + q = warptime[warptimeFrame ^ 1];
    for(i=0; i<video_area; i++) {
    if(*diff++) {
    *q = PLANES - 1;

  • Incompatible types in assignment

    Hello everyone,
    I'm quite new to objective-c programming. So far, i pretty much solved everything either on my own with the documentation, and with some googling. One problem i haven't solved was how to detect a swipe on a uiscrollview, but i thought i found another way to do it.
    However, when i'm trying to get the contentoffset.x of my scrollview (named dayScrollView) and store it in a CGFloat, i get a compiler error ' incompatible types in assignment'. I have been able to access it just fine, however now it's giving me trouble.
    I declared the float in the header file (CGFloat *deceleratingTouch), and then tried to store it in the implementation file (deceleratingTouch=dayScrollView.contentOffset.x;). What is possible that went wrong? as i said, i'm quite new, so i sometimes make the stupidest mistakes.

    Ok, it was solved. Apparently, CGFloat doesn't need the asterisk if you declare it in the header file. That's what i said about stupid mistakes

  • Incompatible type error

    I am receiving the following errors:
    incompatible types
    found: int
    required: boolean
    if (accessCode = 8345)
    if (accessCode = 55875)
    if (accessCode = 999909)
    I do not understand why I am getting the errors. accessCode is of type int.
    Thanks in advance for any input.
    int accessCode = Integer.parseInt( String.valueOf(
      securityCodeJPasswordField.getPassword() ) );
         int code;
         if (accessCode >= 1645 && accessCode <= 1689)
             code = 1;
         else
         if (accessCode  = 8345)
                code = 2;
         else
         if (accessCode = 55875)
             code = 3;
         else
         if (accessCode = 999898)
             code = 4;
         else
         if (accessCode >= 1000006 && accessCode <= 1000008)
             code = 5;
         else
         if (accessCode < 1000)
             code = 6;
         else
                        code = accessCode;

    Thanks !! I am stuck in the coding syntax that I use in my job: SAS

  • OCI8 compile errors on SLES 10

    I'm stuck. New to Linux, so the error messages are greek. I've googled for days. Can anyone decipher the issue here? Thanks in advance for any help!!
    Used RPM to install instant client 10.2.0.4 (user didn't want v11).
    PHP 5.2.5 installed.
    Used yast to install php5-dev pacakge
    Receive the following output when trying to install oci8 using pecl (sorry it's so long, but I didn't know which part was important - and I did delete a chunk out of the middle that seemed repetitive, since there is a character limit in this forum...):
    +<server>:~ # pecl install oci8+
    downloading oci8-1.3.5.tar ...
    Starting to download oci8-1.3.5.tar (Unknown size)
    +.............................................done: 1,071,616 bytes+
    +10 source files, building+
    running: phpize
    Configuring for:
    PHP Api Version:         20041225
    Zend Module Api No:      20060613
    Zend Extension Api No:   220060519
    +1. Please provide the path to the ORACLE_HOME directory. Use+
    +'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant+
    Client : autodetect
    +1-1, 'all', 'abort', or Enter to continue:+
    building in /var/tmp/pear-build-<username>/oci8-1.3.5
    +running: /tmp/pear/cache/oci8-1.3.5/configure --with-oci8+
    checking for egrep... grep -E
    checking for a sed that does not truncate output... /usr/bin/sed
    checking for gcc... gcc
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ANSI C... none needed
    checking whether gcc and cc understand -c and -o together... yes
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... i686-suse-linux
    checking host system type... i686-suse-linux
    checking target system type... i686-suse-linux
    checking for PHP prefix... /usr
    checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main
    -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext
    -I/usr/include/php5/ext/date/lib
    checking for PHP extension directory... /usr/lib/php5/extensions
    checking for PHP installed headers prefix... /usr/include/php5
    checking for re2c... no
    configure: WARNING: You will need re2c 0.12.0 or later if you want to regenerate
    PHP parsers.
    checking for gawk... gawk
    checking for Oracle (OCI8) support... yes, shared
    checking PHP version... 5.2.5, ok
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for long int... yes
    checking size of long int... 4
    checking checking if we're on a 64-bit platform... no
    checking Oracle ORACLE_HOME install directory... /usr/lib/oracle/10.2.0.4/client
    checking ORACLE_HOME library validity... lib
    checking Oracle version... 10.1
    checking for ld used by gcc... /usr/i586-suse-linux/bin/ld
    checking if the linker (/usr/i586-suse-linux/bin/ld) is GNU ld... yes
    checking for /usr/i586-suse-linux/bin/ld option to reload object files... -r
    checking for BSD-compatible nm... /usr/bin/nm -B
    checking whether ln -s works... yes
    checking how to recognise dependent libraries... pass_all
    checking dlfcn.h usability... yes
    checking dlfcn.h presence... yes
    checking for dlfcn.h... yes
    checking for g77... no
    checking for f77... no
    checking for xlf... no
    checking for frt... no
    checking for pgf77... no
    checking for fort77... no
    checking for fl32... no
    checking for af77... no
    checking for f90... no
    checking for xlf90... no
    checking for pgf90... no
    checking for epcf90... no
    checking for f95... no
    checking for fort... no
    checking for xlf95... no
    checking for ifc... no
    checking for efc... no
    checking for pgf95... no
    checking for lf95... no
    checking for gfortran... gfortran
    checking whether we are using the GNU Fortran 77 compiler... yes
    checking whether gfortran accepts -g... yes
    checking the maximum length of command line arguments... 32768
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for objdir... .libs
    checking for ar... ar
    checking for ranlib... ranlib
    checking for strip... strip
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -fPIC
    checking if gcc PIC flag -fPIC works... yes
    checking if gcc static flag -static works... yes
    checking if gcc supports -c -o file.o... yes
    checking whether the gcc linker (/usr/i586-suse-linux/bin/ld) supports shared
    libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... cat: /etc/ld.so.conf.d/*.conf: No such
    file or directory
    GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    configure: creating libtool
    appending configuration tag "CXX" to libtool
    appending configuration tag "F77" to libtool
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... no
    checking for gfortran option to produce PIC... -fPIC
    checking if gfortran PIC flag -fPIC works... yes
    checking if gfortran static flag -static works... yes
    checking if gfortran supports -c -o file.o... yes
    checking whether the gfortran linker (/usr/i586-suse-linux/bin/ld) supports shared
    libraries... yes
    checking dynamic linker characteristics... cat: /etc/ld.so.conf.d/*.conf: No such
    file or directory
    GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    configure: creating ./config.status
    config.status: creating config.h
    running: make
    +/bin/sh /var/tmp/pear-build-<username>/oci8-1.3.5/libtool --mode=compile gcc  -I.+
    -I/tmp/pear/cache/oci8-1.3.5 -DPHP_ATOM_INC
    -I/var/tmp/pear-build-<username>/oci8-1.3.5/include
    -I/var/tmp/pear-build-<username>/oci8-1.3.5/main -I/tmp/pear/cache/oci8-1.3.5
    -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM
    -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib
    -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/cache/oci8-1.3.5/oci8.c -o oci8.lo
    mkdir .libs
    gcc -I. -I/tmp/pear/cache/oci8-1.3.5 -DPHP_ATOM_INC
    -I/var/tmp/pear-build-<username>/oci8-1.3.5/include
    -I/var/tmp/pear-build-<username>/oci8-1.3.5/main -I/tmp/pear/cache/oci8-1.3.5
    -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM
    -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib
    -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/cache/oci8-1.3.5/oci8.c  -fPIC -DPIC -o
    +.libs/oci8.o+
    In file included from /tmp/pear/cache/oci8-1.3.5/oci8.c:51:
    +/tmp/pear/cache/oci8-1.3.5/php_oci8_int.h:56:17: error: oci.h: No such file or+
    directory
    In file included from /tmp/pear/cache/oci8-1.3.5/oci8.c:51:
    specifier-qualifier-list before 'text'
    +/tmp/pear/cache/oci8-1.3.5/php_oci8_int.h:183: error: expected+
    function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:992: error: (Each undeclared identifier is+
    reported only once
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:992: error: for each function it appears in.)+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:992: error: expected ';' before 'errstatus'+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:993: error: 'sb4' undeclared (first use in this+
    named 'env'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:1042: error: called object+
    +'<erroneous-expression>' is not a function+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:1042: error: 'OCI_HTYPE_ENV' undeclared (first+
    use in this function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:1044: error: 'zend_oci_globals' has no member+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2392: error: 'php_oci_out_column' has no+
    member named 'retlen'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2392: warning: assignment makes integer from+
    pointer without a cast
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2401: error: 'php_oci_out_column' has no+
    member named 'data'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2401: warning: initialization from incompatible+
    pointer type
    +/tmp/pear/cache/oci8-1.3.5/oci8.c: In function 'php_oci_fetch_row':+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2416: error: 'ub4' undeclared (first use in this+
    function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2416: error: expected ';' before 'nrows'+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2462: error: 'nrows' undeclared (first use in this+
    function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2462: error: too many arguments to function+
    +'php_oci_statement_fetch'+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2468: error: 'php_oci_statement' has no+
    member named 'ncolumns'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2468: warning: comparison between pointer and+
    integer
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2475: error: 'php_oci_out_column' has no+
    member named 'idle_expiry'
    named 'debug_mode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2568: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2568: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2568: error: 'php_oci_spool' has no member+
    named 'env'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2568: error: 'dvoid' undeclared (first use in this+
    function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2568: error: expected expression before ')'+
    token
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2568: error: invalid operands to binary *+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2568: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2570: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2570: error: 'OCI_SUCCESS' undeclared (first+
    use in this function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2571: error: 'zend_oci_globals' has no member+
    named 'err'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2571: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2580: error: 'zend_oci_globals' has no member+
    named 'debug_mode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2580: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2580: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2580: error: expected expression before ')'+
    token
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2580: error: invalid operands to binary *+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2580: error: 'zend_oci_globals' has no member+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2592: error: 'OCI_SPC_HOMOGENEOUS'+
    undeclared (first use in this function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2598: error: 'zend_oci_globals' has no member+
    named 'debug_mode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2598: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2598: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2598: error: 'OraText' undeclared (first use in+
    this function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2598: error: expected expression before ')'+
    token
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2598: error: invalid operands to binary *+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2598: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2600: error: 'zend_oci_globals' has no member+
    named 'persistent_timeout'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2608: error: expected ';' before 'timeout'+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2610: error: 'zend_oci_globals' has no member+
    named 'debug_mode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2610: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2610: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2610: error: expected expression before ')'+
    token
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2610: error: invalid operands to binary *+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2610: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2612: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2613: error: 'zend_oci_globals' has no member+
    named 'err'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2613: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2625: error: 'zend_oci_globals' has no member+
    named 'debug_mode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c: In function 'php_oci_get_spool':+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2680: error: 'php_oci_spool' has no member+
    named 'spool_hash_key'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2680: error: 'php_oci_spool' has no member+
    named 'spool_hash_key'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2680: warning: passing argument 1 of 'strlen'+
    from incompatible pointer type
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2680: warning: passing argument 2 of+
    +'_zend_hash_add_or_update' from incompatible pointer type+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2682: error: 'php_oci_spool' has no member+
    named 'spool_hash_key'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2682: warning: passing argument 1 of 'strlen'+
    from incompatible pointer type
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2683: error: 'php_oci_spool' has no member+
    named 'spool_hash_key'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c: At top level:+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2703: error: expected '=', ',', ';', 'asm' or+
    +'__attribute__' before '*' token+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c: In function 'php_oci_old_create_session':+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2728: error: 'ub4' undeclared (first use in this+
    function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2728: error: expected ';' before+
    +'statement_cache_size'+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2730: error: 'zend_oci_globals' has no member+
    named 'debug_mode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2735: error: 'php_oci_connection' has no+
    member named 'env'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2735: error: 'php_oci_connection' has no+
    member named 'charset'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2740: error: 'zend_oci_globals' has no member+
    named 'debug_mode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2740: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2740: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2740: error: 'php_oci_connection' has no+
    member named 'env'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2740: error: 'dvoid' undeclared (first use in this+
    function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2740: error: expected expression before ')'+
    token
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2740: error: invalid operands to binary *+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2740: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2742: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2742: error: 'OCI_SUCCESS' undeclared (first+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2748: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2748: error: 'php_oci_connection' has no+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2792: error: expected expression before ')'+
    token
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2792: error: invalid operands to binary *+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2792: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2794: error: 'zend_oci_globals' has no member+
    named 'debug_mode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2801: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2801: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2801: error: 'php_oci_connection' has no+
    member named 'svc'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2801: error: 'OCI_HTYPE_SVCCTX' undeclared+
    +(first use in this function)+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2801: error: 'php_oci_connection' has no+
    member named 'server'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2801: error: 'OCI_ATTR_SERVER' undeclared+
    +(first use in this function)+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2801: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2809: error: 'php_oci_connection' has no+
    member named 'svc'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2809: error: 'php_oci_connection' has no+
    member named 'session'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2809: error: 'OCI_ATTR_SESSION' undeclared+
    +(first use in this function)+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2818: error: 'php_oci_connection' has no+
    member named 'svc'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2818: error: 'zend_oci_globals' has no member+
    named 'err'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2818: error: expected expression before ')'+
    token
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2818: error: invalid operands to binary *+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2818: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2820: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2821: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2825: error: expected expression before ')'+
    token
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2825: error: invalid operands to binary *+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2825: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2833: error: expected ';' before 'cred_type'+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2837: error: 'cred_type' undeclared (first use in+
    this function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2837: error: 'OCI_CRED_EXT' undeclared (first+
    use in this function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2841: error: 'OCI_STMT_CACHE' undeclared+
    +(first use in this function)+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2841: error: invalid operands to binary |+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2841: error: incompatible types in assignment+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2843: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2843: error: 'php_oci_connection' has no+
    member named 'svc'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2843: error: 'zend_oci_globals' has no member+
    named 'err'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2843: error: 'php_oci_connection' has no+
    member named 'session'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2843: error: expected ')' before 'cred_type'+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2843: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2845: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2850: error: 'OCI_SUCCESS_WITH_INFO'+
    undeclared (first use in this function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2857: error: 'zend_oci_globals' has no member+
    named 'err'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2857: warning: comparison between pointer and+
    integer
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2858: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2862: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2862: error: expected expression before ')'+
    token
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2862: error: invalid operands to binary *+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2862: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2864: error: 'zend_oci_globals' has no member+
    named 'err'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2991: error: 'ub1' undeclared (first use in this+
    function)
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2991: error: expected expression before ')'+
    token
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2991: error: invalid operands to binary *+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2991: error: 'zend_oci_globals' has no member+
    named 'in_call'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2992: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2993: error: 'zend_oci_globals' has no member+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2997: error: 'php_oci_connection' has no+
    member named 'next_pingp'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2999: error: 'zend_oci_globals' has no member+
    named 'err'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:2999: warning: comparison between pointer and+
    named 'errcode'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:3003: error: 'php_oci_connection' has no+
    member named 'next_pingp'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:3003: error: invalid operands to binary >+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:3003: error: 'php_oci_connection' has no+
    member named 'next_pingp'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:3003: error: invalid operands to binary >=+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:3006: error: 'php_oci_connection' has no+
    member named 'next_pingp'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:3006: error: 'zend_oci_globals' has no member+
    named 'spool_hash_key'
    +/tmp/pear/cache/oci8-1.3.5/oci8.c: At top level:+
    +/tmp/pear/cache/oci8-1.3.5/oci8.c:3082: error: expected '=', ',', ';', 'asm' or+
    +'__attribute__' before 'php_oci_ping_init'+
    +make: *** [oci8.lo] Error 1+
    ERROR: `make' failed
    +<server>:~ #+

    Unset ORACLE_HOME. It should not be set for Instant Client (except in one rare case).
    Also instead of leaving the install to "autodetect", try using the form "instantclient,/usr/lib/oracle/10.2.0.4/client/lib". See http://blogs.oracle.com/opal/2009/03/pecl_install_prompts_explained.html for a discussion of answering the PECL install prompts.
    Also see http://www.oracle.com/technology/pub/notes/technote_php_instant.html
    and http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf

  • Perplexing compilation errors with latest org.restlet.jar

    When compiling with the latest org.restlet.jar I am get some perplexing error messages. They just don't make sense according to definitions in the source code
    ContactComponent.java:79: error: method setInternalRouter in class Component can
    not be applied to given types;
    setInternalRouter(router);
    ^
    required: org.restlet.Router
    found: org.restlet.routing.Router
    reason: actual argument org.restlet.routing.Router cannot be converted to org.
    restlet.Router by method invocation conversion
    // Component includes reference to import org.restlet.routing.Router;
    ContactComponent.java:82: error: no suitable method found for add(org.restlet.ro
    uting.VirtualHost)
    getHosts().add(host);
    ^
    method List.add(int,org.restlet.VirtualHost) is not applicable
    (actual and formal argument lists differ in length)
    method List.add(org.restlet.VirtualHost) is not applicable
    (actual argument org.restlet.routing.VirtualHost cannot be converted to or
    g.restlet.VirtualHost by method invocation conversion)
    // Component includes reference to import org.restlet.routing.VirtualHost;
    ContactComponent.java:117: error: incompatible types
    org.restlet.routing.Router router = getInternalRouter();
    ^
    required: org.restlet.routing.Router
    found: org.restlet.Router
    // Component includes references to import org.restlet.routing.Router
    ContactComponent.java:139: error: no suitable method found for handle(org.restle
    t.Request,org.restlet.Response)
    super.handle(request, response);
    ^
    method Component.handle(org.restlet.data.Request,org.restlet.data.Response)
    is not applicable
    (actual argument org.restlet.Request cannot be converted to org.restlet.da
    ta.Request by method invocation conversion)
    method Uniform.handle(org.restlet.data.Request) is not applicable
    (actual and formal argument lists differ in length)
    // there is no such thing as org.restlet.data.Request
    thank you for any insight

    gilbertoblue wrote:
    They just don't make sense according to definitions in the source codeTo me they seem to make a lot of sense. Assuming that backwards compatibility has been broken.
    ContactComponent.java:79: error: method setInternalRouter in class Component can
    not be applied to given types;
    setInternalRouter(router);
    ^
    required: org.restlet.Router
    found: org.restlet.routing.Router
    reason: actual argument org.restlet.routing.Router cannot be converted to org.
    restlet.Router by method invocation conversionYou have two different classes there. I'm assuming that one of them is from the old version and one is from the new version. Make sure your imports are correct and that the classpath includes the right library.
    // there is no such thing as org.restlet.data.RequestAre you sure? Check both versions of the library, I'm quite sure that the compiler knows what it's missing.

  • WEB ADI Error with Excel - Compile Error

    I am trying to export data to Excel. The process works until the data is loaded to Excel whereupon I get a Microsoft Visual Basic error "Compile Error: User-defined type not defined.
    Behind the error message is several screens from VB with the following line highlighted "Dim oParser As New SAXXMLReader30"

    Please post the details of the application release, database version and OS.
    I am trying to export data to Excel. The process works until the data is loaded to Excel whereupon I get a Microsoft Visual Basic error "Compile Error: User-defined type not defined.Can you find any details about the error in the BNE.log file? -- How to Create a BNE Log For Web Adi Issues and Errors? [ID 817023.1]
    Behind the error message is several screens from VB with the following line highlighted "Dim oParser As New SAXXMLReader30"Please see if (Web ADI: Compile Error - Userdefined Type Not Defined LEDGER_IDDetails [ID 1319992.1]) is applicable.
    Thanks,
    Hussein

  • Problem with incompatible types

    Can you help me out where the problem is? The Child extends the Iterator<GenericTypeTest> so why the assignment doesn`t work? Thank you in advance
    class GenericTypeTest implements Iterator<GenericTypeTest> {
        public GenericTypeTest() {
            Child a = null;
            Iterator<GenericTypeTest> b = null;
            b = a;
            Set<Child> sa = null;
            Set<Iterator<GenericTypeTest>> sb = null;
            sb = sa; // HERE: COMPILATION PROBLEM
            // (Incompatible types: found: Set<Child> required: Set<Iterator<GenericTypeTest>>)
        public boolean hasNext() {
            return false;
        public GenericTypeTest next() {
            return null;
        public void remove() {
    class Child extends GenericTypeTest {}

    You can only assign from a subtype to a supertype. And the subtype/supertype relationship for generic types isn't what you think it is. Read this FAQ entry for more information, especially the part around the sentence "The prerequisite is that at least one of the involved type arguments is a wildcard."

  • Neophyte: Incompatible Types

    Hi all, new to programming and Java in particular. Here is the code:
    import java.net.*;
    import java.io.*;
    class WHWWW {
         public static void main (String[] arg) {
              URL u = new URL("http://www.google.gov/");
              FilterInputStream ins = u.openStream();
              InputStreamReader isr = new InputStreamReader(ins);
              BufferedReader whiteHouse = new BufferedReader(isr);
              System.out.println(google.readLine());
    Here is the error:
    Incompatible Types
    found: java.io.InputStream
    required: java.io.FilterInputStream
    FilterInputStream ins = u.openStream();
    ^
    Thanks for the help.

    Create one of the subclasses of FilterInputStream
    instead of InputStream. Perhaps BufferedInputStream
    would be appropriate here.
    Whoops. That should have been ]Create one of the subclasses of FilterInputStream instead, using InputStream (as the argument to the constructor). Perhaps BufferedInputStream would be appropriate here.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Help on Incompatible types

    Sample 1:
    public interface I<T extends I<?>>
      I<? extends I<T>> m1 ();
    public class Z<T extends I<?>> implements I<T>
      public I<? extends I<T>> m1 ()
        return m2();
      protected I<? extends I<T>> m2 ()
        return null;
    javac Z.javacompiled with no problems
    Sample 2:
    public interface I<Tx, T extends I<Tx, ?>>
      I<Tx, ? extends I<Tx, T>> m1 ();
    public class Z<Tx, T extends I<Tx, ?>> implements I<Tx, T>
      public I<Tx, ? extends I<Tx, T>> m1 ()
        return m2();
      protected I<Tx, ? extends I<Tx, T>> m2 ()
        return null;
    javac Z.javaZ.java:5: incompatible types
    found : I<Tx,capture of ? extends I<Tx,T>>
    required: I<Tx,? extends I<Tx,T>>
    return m2();
    ^
    1 error
    Well... can anyone help with this? Or at least some explanations why adding second generic generates this problem?

    The problem is in the recursion, not in the second type argument. If you changed your first interface from
        public interface I<T extends I<?>> {} to
        public interface I<T extends I<T>> {} you would run into the same error message. For sake of clarity let's discuss the issue using your first example in a slightly simplified form:
        public interface I<T extends I<T>> {}
        public class Z<E>
          public I<? extends I<E>> m1 ()
            return m2();
            /* error: incompatible types
               found   : I<capture of ? extends I<E>>
               required: I<? extends I<E>>
               return m2();
                        ^
          protected I<? extends I<E>> m2 ()
          { return null; }
        }The error message is not awfully helpful, because the "E" is different in both types.
    Method m2 returns a reference of type I<capture of ? extends I<E>>, where E extends I<capture of ? extends I<E>>, that is, it returns a concrete instantiation of the interface, namely I<SomeType> with a type that extends I<SomeType> with a type that extends ... continued recursively.
    On the other hand, method m1 is supposed to return a reference of type I<? extends I<E>>, where E extends I<? extends I<E>>, that is, it returns a wildcard instantiation of the interface, namely I<? extends I<SomeType>> with a type that extends I<? extends I<SomeType>> with a type that extends ... continued recursively.
    And here is the point: The first construct leads to a concrete instantiation like a List<List<List<String>>>. The second construct lead to a recursive wildcard instantiation like List<? extends List<? extends List<?>>>. As soon as the wildcard appears on a nested level, the types are no longer compatible.
    It's like assigning a List<List<String>> to a List<List<?>>. It's not permitted because the first is a list of string-lists and the second is a list of mixed-lists. You cannot assign one to the other.
    In your example, changing
        public interface I2<Tx, T extends I2<Tx, ?>> to
        public interface I2<Tx, T extends I2<?, ?>>might do the trick.
    (As usual, ignore the annoying additional angle brackets.)

  • Compilation error regarding incompatible "types"?

    I am receiving an error saying:
    pokerdeck.java incompatible types
    found java.lang.String
    required ie.ucd.Card
    Card card = "";
    What does this mean exactly and how might I overcome such a problem?

    I am receiving an error saying:
    pokerdeck.java incompatible types
    found java.lang.String
    required ie.ucd.Card
    Card card = "";
    What does this mean exactly and how might I overcome
    such a problem?Switch on your brain.
    Card here = String here
    17 = Hello World
    Don't you think there's something that doesn't match?

  • Compiler error  type of object in for (Class obj : Items) - why?

    Hi all,
    I'm new to Java generics and am in the process of converting some
    legacy code. I have encountered a particular error which I do not
    understand the reason for, since I think the compiler has enough
    information about the code to work out type information. The following
    code shows a test class which demonstrates this error:
    import java.util.Collection;
    public class Test
        interface Base {}
        static class Impl1 implements Base{}
        public <T extends Base> Collection<T> getCollection(Class<? extends Base> cls)
            return null;
        void someMethod()
            for ( Impl1 obj : getCollection( Impl1.class ))
                // *** compiler complains about the line above ***
                // compiler says:
                // Test.java:22: incompatible types
                // found   : Test.Base
                // required: Test.Impl1
                //        for ( Impl1 obj : getCollection( Impl1.class ))
                //                                        ^
        void someMethod2()
            Collection<Impl1> coln = getCollection(Impl1.class);
            for (Impl1 obj : coln)
                // do something here with obj
    }Why should the compiler complain where it does ( the line marked with
    asterisks) in someMethod, but does not reject the declaration statement
    in someMethod2? I would have assumed both are the same and the
    compiler has the same type information at its disposal to determine
    the correct type.
    Cheers,
    Bonny

    The Java 5 compiler not only looks at a method's name and arguments, but also at its return value in order to determine whether a method is callable and what type should be infered for its type parameters.
    In your example the type parameter T is only used in the declaration of the method's return type. Note that there is no relation between T and the type of the argument cls!
    Thus, the compiles needs to know what type of variable the return value will be assigned to.
    Hence, someMethod2 can be resolved, whereas in someMethod there is no assignment of the return value. (Rather, an implicit call to Iterable.iterator()).
    You can solve this problem by forming a relation between the method's argument, its return type and its type parameter. Just declare the method like this:
    public <T extends Base> Collection<T> getCollection(Class<T> cls)
            return null;
        }

Maybe you are looking for

  • CRM BDoc Modeler - Problem while creating a new segment

    Hi all; I have created a new BDoc type and wanted to add a segment. I imported a structure with some QUAN fields and a UNIT type fields. While activating segment, I got an error. I saw that the structure was not activated since I used some QUAN type

  • Purchase Order Type

    Hi, When creating a PO from a requisition, is it possible to determine the order type of the PO based on purchasing organisation or vendor? I have created a different order type from the standard NB in customizing, but how do I make sure that at PO c

  • Problem in displaying Array Position?

    hi, I am having a problem in displaying the array position of a sorted Array for ex: int[] a = {4,3,1,7}for sorting the array i am using Arrays.sort(a); then the output will be a = {1,3,4,7}now according to this i need to display the array position o

  • Scheduled delivery OfficeJet 6500A

    I have read all the directions on the site.  I am unable to stop the scheduled delivery apps.  I can not find the "set-up" button.  I am not able to "scroll down" to find "my apps".  Any ideas on how I'm supposed to get these paper wasting apps to st

  • How to covert EPA to SDA file

    Dear all, Can any one help me how to conevert EPA file to SDA. Thanks and Regards Suresh Kumar