Code Duplication    Length = 6-6 lines in 2 locations

lib/private/Files/Cache/Scanner.php 2 locations

@@ 329-334 (lines=6) @@
326
		if ($reuse === -1) {
327
			$reuse = ($recursive === self::SCAN_SHALLOW) ? self::REUSE_ETAG | self::REUSE_SIZE : self::REUSE_ETAG;
328
		}
329
		if ($lock) {
330
			if ($this->storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) {
331
				$this->storage->acquireLock('scanner::' . $path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider);
332
				$this->storage->acquireLock($path, ILockingProvider::LOCK_SHARED, $this->lockingProvider);
333
			}
334
		}
335
		try {
336
			$data = $this->scanFile($path, $reuse, -1, null, $lock);
337
			if ($data and $data['mimetype'] === 'httpd/unix-directory') {
@@ 342-347 (lines=6) @@
339
				$data['size'] = $size;
340
			}
341
		} finally {
342
			if ($lock) {
343
				if ($this->storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) {
344
					$this->storage->releaseLock($path, ILockingProvider::LOCK_SHARED, $this->lockingProvider);
345
					$this->storage->releaseLock('scanner::' . $path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider);
346
				}
347
			}
348
		}
349
		return $data;
350
	}