code compiles when null was assigned in indirect way

XMLWordPrintable

    • Type: Bug
    • Resolution: Not an Issue
    • Priority: P3
    • None
    • Affects Version/s: 5.0
    • Component/s: tools
    • sparc
    • solaris_2.1

      /**
       *
       * This class should not compile
       * <pre>
       * Reason :- This class will fail to compile beacuse, this will tries
       * to convert <b>null</b> value to primitive object wrapper.
       * </pre>
       *
       */
      public class ErrorCondition1 {

              public static void main(String[] args) {
                      Integer inte= null;
                      int no =90;
                      no = inte;
              }
      }
      But this class get's compiled.

            Assignee:
            Neal Gafter (Inactive)
            Reporter:
            Viswadeep Veguru (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: