Skip to content

Commit f02acb5

Browse files
VIEWERJAVA-3273 - Cannot enter synchronized block because the return value is null
1 parent 0fc646b commit f02acb5

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ User Interface for GroupDocs.Viewer for Java. API for easily integrating a docum
2121
<dependency>
2222
<groupId>com.groupdocs</groupId>
2323
<artifactId>groupdocs-viewer-ui</artifactId>
24-
<version>23.7</version>
24+
<version>23.7.1</version>
2525
</dependency>
2626

2727
<dependency>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.groupdocs</groupId>
88
<artifactId>groupdocs-viewer-ui</artifactId>
9-
<version>23.7</version>
9+
<version>23.7.1</version>
1010
<packaging>jar</packaging>
1111

1212
<name>GroupDocs.Viewer for Java User Interface</name>

res/simplified-pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<artifactId>groupdocs-viewer-ui</artifactId>
77
<name>GroupDocs.Viewer for Java User Interface</name>
88
<url>https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java-UI</url>
9-
<version>23.7</version>
9+
<version>23.7.1</version>
1010
<description>
1111
GroupDocs.Viewer UI is a rich UI interface that designed to work in conjunction with GroupDocs.Viewer for Java to display most popular file and document formats in a browser.
1212
To integrate GroupDocs.Viewer UI in your Java project you just need to configure Viewer API and handle requests using specific endpoint handler provided in GroupDocs.Viewer.UI.

samples/groupdocs-viewer-java-ui-spring-boot/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<dependency>
3232
<groupId>com.groupdocs</groupId>
3333
<artifactId>groupdocs-viewer-ui</artifactId>
34-
<version>23.7</version>
34+
<version>23.7.1</version>
3535
</dependency>
3636

3737
<dependency>

src/main/java/com/groupdocs/viewerui/ui/api/viewer/BaseViewer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ private Page renderPageInternal(Viewer viewer, FileCredentials fileCredentials,
196196

197197
private static synchronized Object getFileLock(String filename) {
198198
final Object lock = new Object();
199-
return _asyncLock.computeIfAbsent(filename, k -> new WeakReference<>(lock)).get(); // Retrieve the actual lock object
199+
final Object actualLock = _asyncLock.computeIfAbsent(filename, k -> new WeakReference<>(lock)).get();// Retrieve the actual lock object
200+
return actualLock == null ? lock : actualLock;
200201
}
201202

202203
private static void cleanupUnusedLocks() {

src/main/java/com/groupdocs/viewerui/ui/core/caching/CachingViewer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ private static void synchronizedBlock(String fileName, Runnable synchronizedBloc
209209

210210
private static synchronized Object getFileLock(String filename) {
211211
final Object lock = new Object();
212-
return _asyncLock.computeIfAbsent(filename, k -> new WeakReference<>(lock)).get(); // Retrieve the actual lock object
212+
final Object actualLock = _asyncLock.computeIfAbsent(filename, k -> new WeakReference<>(lock)).get(); // Retrieve the actual lock object
213+
return actualLock == null ? lock : actualLock;
213214
}
214215

215216
private static void cleanupUnusedLocks() {

0 commit comments

Comments
 (0)