facebook

Generics of Class Class

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #242149 Reply

    Roel De Nijs
    Member

    What operating system and version are you running? WinXP Professional SP 2
    What Eclipse version and build id are you using? Version: 3.1.1 Build id: M20050929-0840
    – Was Eclipse freshly installed for MyEclipse? Yes
    – Are any other external plugins installed? No
    – How many plugins in the <eclipse>/plugins directory are like org.eclipse.pde.* 4
    What MyEclipse version are you using? Version: 4.0.1 Build id: 20050930-4.0.1-GA
    What JDK version are you using to run Eclipse? jdk1.5.0_04
    What JDK version are you using to launch your application server? jdk1.5.0_04
    What application server are you using? Tomcat 5.0
    Are there any exceptions in the Eclipse log file? No
    What steps did you take that resulted in the issue?

    I wanted to change the following line of code

        private transient Logger logBestand = Logger.getLogger(Login.class);

    with

        private transient Logger logBestand = Logger.getLogger(Class<Login>);

    If you read documentation of new Java 5.0 features this should be possible, but i got following error

    
    Severity = 2
    Description = Syntax error on token ">", Expression expected after this token
    Id = 103043
    

    Of course i changed the compiler compliance level to 5.0 and i don’t have any problems with other generics (e.g. HashMap<String, String> works fine).

    ps. the class Logger is from the log4j-package

    #242154 Reply

    Riyad Kalla
    Member

    hysterio,
    Are you having this trouble while editing a Java source file? The Java editor is provided by the base JDT project from eclipse.org, we don’t instrument it in any way.

    #242216 Reply

    Roel De Nijs
    Member

    Hi,

    It’s my mistake: class literal Foo.class is of type Class<Foo> and that’s not the same thing as Foo.class itself (so the error shown is logical).

    Greetz
    And thanks for the quick reply

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Generics of Class Class

You must be logged in to post in the forum log in