Menu

#23 WorkerThread int getState method clashes with Java 1.5

v1.0 (example)
closed-out-of-date
None
5
2021-07-15
2005-07-07
Phil Shaw
No

The class net.javacoding.jspider.core.threading.
WorkerThread has a method getState that clashes with
the Java 1.5 method in the superclass Thread. The
superclass expects the type java.lang.Thread.State to be
returned.

The Sun Java 1.5 compiler gives the error "attempting to
use incompatible return type".

This method is called in WorkerThreadPool, where it is
compared against WorkerThread.
WORKERTHREAD_BLOCKED, WorkerThread.
WORKERTHREAD_BUSY and WorkerThread.
WORKERTHREAD_IDLE.

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I just bumped onto this prog. after having made my own
    crappy multithreaded link checker...

    anyway, back to this problem easy fix is to just rename the
    getState() method in the WorkerThread.java to something of
    your choice like getStateMod() ... and then changing the
    call to the old getState() in your WorkerThreadPool to
    getStateMod()... this is assuming it's not called
    elsewhere.. if it is then crap..

     
  • EJP

    EJP - 2021-07-15
    • status: open --> closed-out-of-date
    • assigned_to: Günther Van Roey
    • Group: --> v1.0 (example)
     

Log in to post a comment.

MongoDB Logo MongoDB