Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 509543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:01:17+00:00 2026-05-13T07:01:17+00:00

I have a class that looks like the following. This class compiles fine on

  • 0

I have a class that looks like the following. This class compiles fine on Eclipse build 20090920-1017:

public class MyScheduledExecutor implements ScheduledExecutorService {

    ...

    public <T> List<Future<T>> invokeAll(Collection<Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException {
        ...
    }


    public <T> List<Future<T>> invokeAll(Collection<Callable<T>> tasks) throws InterruptedException {
        ...
    }


    public <T> T invokeAny(Collection<Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
        ...
    }


    public <T> T invokeAny(Collection<Callable<T>> tasks) throws InterruptedException, ExecutionException {
        ...
    }

    ...

}

However, if I try to compile in IntelliJ 9, I get a compilation error. It will only compile in IntelliJ if I replace all references to <Callable<T>> with <? extends Callable<T>>. For example:

    public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException {
        ...
    }

Unfortunately, if I then try to compile the modified class back in Eclipse again, I get a compilation error.

Name clash: The method invokeAll(Collection<? extends Callable<T>>) of type 
SingleScheduledExecutor has the same erasure as invokeAll(Collection<Callable<T>>) of
type ExecutorService but does not override it

Is there any way I can create a class that implements ScheduledExectorService that will compile under both IntelliJ and Eclipse? Both IDEs appear to be configured to use Java 1.5, which is correct for my deployment platform.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:01:18+00:00Added an answer on May 13, 2026 at 7:01 am

    In Java 6, ExecutorService declares the following method (for example):

    <T> T invokeAny(Collection<? extends Callable<T>> tasks)
                throws InterruptedException,
                       ExecutionException
    

    But in Java 5, the same method is declared like this in ExecutorService:

    <T> T invokeAny(Collection<Callable<T>> tasks)
                throws InterruptedException,
                       ExecutionException
    

    I don’t have Java 5 installed and can’t reproduce the error with Eclipse Java EE Galileo 20090920-1017 (I’m under Ubuntu and sun-java5-jdk has been removed from Karmic’s repositories and I’m too lazy to install it manually) but, actually, I think that Eclipse is right.

    Are you sure you are using a JDK 5 in IntelliJ IDEA (and not a JDK 6 with 1.5 level compliance)?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that looks like the following: public class MyClass { private
We have a class a class that looks something like the following: public class
I have a class that looks like this public class SomeClass { public SomeChildClass[]
I have a class that looks like this: public class TextField : TextBox {
I have a class that looks like this: public class BasePadWI { public WorkItem
Currently I have a class that looks like this: public class MyClass : IMyClass
Assume I have a class that looks like this: class Sample { public string
Well, I have a button in library that looks like following: public class Button
I have something that looks like the following: [CoolnessFactor] interface IThing {} class Tester
I have an hierarchy of classes that looks like the following: class Critical {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.