Menu

#909 (f) deprecated override warning in deprecated context

patched
open-fixed
parser (295)
5
2004-10-09
2004-10-06
Anonymous
No

Compile with flags "-deprecation -g " with jikes/1.21 and everything is fine.
Compile with same flags with jikes/1.22 and we get errors.

---- Error generated ------
Found 1 semantic error compiling "src/bios/jcommon/sql/LogPreparedStatement.java":

123. public void setUnicodeStream (int pos, InputStream is, int len) throws SQLException {
^-------------------------------------------------^
*** Semantic Error: The overridden method "void setUnicodeStream(int pos, java.io.InputStream is, int len) throws java.sql.SQLException;" is deprecated in type "java.sql.PreparedStatement".
--------------------------------------

The source code looks like this:
--------------- Source code parts ------------
public class LogPreparedStatement extends LogStatement implements PreparedStatement {

/**
* @deprecated hubba bubba..
*/
public void setUnicodeStream (int pos, InputStream is, int len) throws SQLException {
//setArg (pos, is);
//p.setUnicodeStream (pos, is, len);
throw (new SQLException ("Trying to use deprecated methods..."));
}

/* Lots of more code. */
----------------------------------

That method is deprecated in the jdk, but since this is an interface it has to be implemented.
Marking it as @deprecated used to work with jikes/1.21

Discussion

  • Elliott Hughes

    Elliott Hughes - 2004-10-06

    this is the same as javac's behavior.

     
  • Nobody/Anonymous

    Neither of jdk/1.4.2 or 1.5.0 gives error or even warnings on the given example. Not even when the compile flags include "-deprecation'

    Javac normally gives a _warning_ when it encounters a method that is deprecated. However if the method has a javadoc with a @deprecated tag javac will not complain.

    So, no I do not think this is the same as javacs behaviour.

     
  • Elliott Hughes

    Elliott Hughes - 2004-10-07

    i see; i understand your complaint now. deprecation warnings should be disabled in deprecated contexts, and this one isn't. i've updated the title accordingly.

     
  • Elliott Hughes

    Elliott Hughes - 2004-10-07
    • assigned_to: nobody --> enh
    • summary: Flag -deprectation causes errors in 1.22, but not in 1.21 --> deprecated override warning in deprecated context
     
  • Elliott Hughes

    Elliott Hughes - 2004-10-09

    fixed in CVS.

     
  • Elliott Hughes

    Elliott Hughes - 2004-10-09
    • summary: deprecated override warning in deprecated context --> (f) deprecated override warning in deprecated context
    • status: open --> open-fixed
     
  • Nobody/Anonymous

    CVS version seems to work ok, thanks.

     
  • Nobody/Anonymous

    Logged In: NO

    used to be jikes bug 4058 (makes it easier to find this page)

     

Log in to post a comment.

MongoDB Logo MongoDB