Uploaded image for project: 'NetarchiveSuite'
  1. NetarchiveSuite
  2. NAS-2680

Synchronization on a non-final field

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.5
    • 5.3.1
    • None
    • None

    Description

      Found an example in the GUI where two different synchronized-blocks locked via what was presumed to be the same object. Inside one of the two blocks, the reference was assigned, so it wasn't the same object in the end, which resulted in those blocks not being synchronized anyway. That would have been caught if the object, that the blocks were locked via, had been declared as final. Ran a project-wide search for the warning "Synchronization on a non-final field", which resulted in 36 hits. These fields should be made final - at some of those 36 occurrences there might be an error hiding like the one I just fixed.

      The one I fixed is everything that is done in this commit (except the "super. " that was accidentally inserted, haha) :
      https://github.com/netarchivesuite/netarchivesuite/commit/65150512d561ee6ecc3eb2ea6906e49f0f0ea857

      Since it's an even cleaner solution to synchronize on 'this' - that's the way I'm correcting these instead now.

      Attachments

        Issue Links

          Activity

            People

              jrg Jeppe Ravn-Grove (Inactive)
              jrg Jeppe Ravn-Grove (Inactive)
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: