Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-4018

incompatible type error - types are compatible

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 11.3
    • None
    • java - Compiler
    • None
    • Mac OS Catalina, Netbeans 11.3

    • Important

    Description

      Error "incompatible types - Object cannot be converted to HsOwnr" when in fact it can and should be.

      Example:

      public class HsHndlr {

      ...

         public static ArrayList<HsOwnr> altrngHsOwnrs = null;

      ...

         static class HsOwnr {

      ...

         }

      }

      public class AppCnvsMIA {

      ...

         for ( HsHndlr.HsOwnr altrngOwnr : HsHndlr.altrngHsOwnrs ) {

      ...

         }

      }

      The above give the error. But a compile (Clean and Build) is successful - no errors in the compile and build. The error is removed when the following is done.

      public class AppCnvsMIA {

      ...

      //   for ( HsHndlr.HsOwnr altrngOwnr : HsHndlr.altrngHsOwnrs ) {

         ArrayList<HsHndlr.HsOwnr> localOwnrsList = HsHndlr.altrngHsOwnrs;
         for ( HsHndlr.HsOwnr altrngOwnr : localOwnrsList ) {

      ...

         }

      }

       This error just cropped up within the last week or so, and I have made no upgrades to the Netbeans environment in months. I think some "automatic" update may have occurred, but I don't know how that could be.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Erikstrup Don
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: