Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4053875

Incorrect reachability with boolean constants and infinite while loops

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 1.4.0
    • 1.2.0
    • tools
    • beta
    • generic
    • solaris_2.5.1

      the jdk1.1.1 javac burps on each method in the following class (and on
      many related variants). do i misunderstand the JLS, or are these bugs?
      if the latter, has anyone reported them?
       
      thanks
      - -andy
       
              public class T
              {
                int foo()
                {
                  while ( false | true )
                    {}
                }
                
                int bar()
                {
                  while ( false == false )
                    {}
                }
              
                int foobar()
                {
                  while ( 1 != 0 )
                    {}
                }
              
                int fubar()
                {
                  while ( 1 + 2 > 0 )
                    {}
                }
              
                int ihtfp()
                {
                  while ( true ? true : false )
                    {}
                }
              }

            wmaddoxsunw William Maddox (Inactive)
            dstoutamsunw David Stoutamire (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: