Menu

#907 (f) constructor of strictfp class not strictfp

patched
open-fixed
5
2004-12-05
2004-09-10
Anonymous
No

Although contructors cannot be explicitly declared strictfp, JLS 8.8.3 says that "a constructor is FP-strict if and only if its class is FP-strict." Jikes does not follow this rule.

The following program prints 'true' when compiled with javac 1.4.2, 'false' when compiled with Jikes:

import java.lang.reflect.*;

public strictfp class StrictFP
{
public StrictFP()
{

}

public static void main(String[] args) throws Throwable
{
Constructor ctor = StrictFP.class.getConstructor(new Class[0]);
System.out.println(Modifier.isStrict(ctor.getModifiers()));
}
}

Discussion

  • Nobody/Anonymous

    This was tested using Jikes 1.21 on both Windows and Linux.

     
  • Elliott Hughes

    Elliott Hughes - 2004-09-14
    • assigned_to: nobody --> enh
    • status: open --> open-fixed
     
  • Elliott Hughes

    Elliott Hughes - 2004-09-14

    default constructors too. fixed in CVS.

     
  • Elliott Hughes

    Elliott Hughes - 2004-12-05
    • summary: constructor of strictfp class not strictfp --> (f) constructor of strictfp class not strictfp
     

Log in to post a comment.

MongoDB Logo MongoDB