Compilation hangs for a class with field double d = 2.2250738585072012e-308

Posted by 01es on Stack Overflow See other posts from Stack Overflow or by 01es
Published on 2011-02-04T08:16:27Z Indexed on 2011/02/04 23:25 UTC
Read the original article Hit count: 241

Filed under:
|
|

I have come across an interesting situation. A coworker committed some changes, which would not compile on my machine neither from the IDE (Eclipse) nor from a command line (Maven). The problem manifested in the compilation process taking 100% CPU and only killing the process would help to stop it. After some analysis the cause of the problem was located and resolved. It turned out be a line "double d = 2.2250738585072012e-308" (without semicolon at the end) in one of the interfaces. The following snipped duplicates it.

public class WeirdCompilationIssue {
   double d = 2.2250738585072012e-308
}

Why would compiler hang? A language edge case?

© Stack Overflow or respective owner

Related posts about java

Related posts about compilation