Skip to content

Commit 0af8dc7

Browse files
committed
fix try with resources statements
Signed-off-by: Alex Knop <[email protected]>
1 parent 754e9f3 commit 0af8dc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/com/owncloud/android/operations/UploadFileOperation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,8 +998,8 @@ private RemoteOperationResult normalUpload(OwnCloudClient client) {
998998
if (result.isSuccess()) {
999999
if (temporalFile.length() == originalFile.length()) {
10001000
// Acquire lock on temporary file
1001-
try (RandomAccessFile randomAccessFile = new RandomAccessFile(temporalFile.getAbsolutePath(), "rw");
1002-
FileChannel tempChannel = randomAccessFile.getChannel();
1001+
try (RandomAccessFile randomAccessTemporalFile = new RandomAccessFile(temporalFile.getAbsolutePath(), "rw");
1002+
FileChannel tempChannel = randomAccessTemporalFile.getChannel();
10031003
FileLock tempFileLock = tempChannel.tryLock()) {
10041004
if (tempFileLock != null) {
10051005
// Use the temporary channel for the upload

0 commit comments

Comments
 (0)