java:S1860 false positive: Synchronize on a new "Object" instead

  • versions used (SonarQube, Scanner, language analyzer)
    SonarQube Version:

The detection of “Synchronization should not be done on instances of value-based classes” in wrong. Following code, pool.intern(applyOid.toString()) is an object of a new thread-safe interner, it’s not value-based classes.

// ...ignore codes
private Interner<String> pool = Interners.newStrongInterner();
// ...ignore codes
public CustomResult<DataSetDTO> saveDatasetToDraft(@PathVariable("applyOid") GUID applyOid, @RequestBody DataSetDTO data) {
	// report java:S1860, Synchronize on a new "Object" instead.
    synchronized (pool.intern(applyOid.toString())) {
        DataSetDTO result =, getOperator());
        return CustomResult.result(true, result);