From c25d5dbcc0e1c43ad59eca937e97902c3ed4dbd9 Mon Sep 17 00:00:00 2001 From: Jozef Tomek Date: Fri, 29 Mar 2024 21:59:36 +0100 Subject: [PATCH] Do not log locking CSS fragments cache for read was interrupted (#1294) --- .../jdt/internal/ui/viewsupport/JavaElementLinks.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java index 59780fc5cfa..e8c46f48289 100644 --- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java +++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/JavaElementLinks.java @@ -562,8 +562,8 @@ private static void cssFragmentsCacheResetListener(PropertyChangeEvent event) { CSS_FRAGMENTS_CACHE_LOCK.unlock(); } } - } catch (InterruptedException e1) { - JavaPlugin.logErrorMessage("Interrupted while waiting for CSS fragments cache lock, cache reset unsuccessful"); //$NON-NLS-1$ + } catch (InterruptedException e) { + JavaPlugin.log(new RuntimeException("Interrupted while waiting for CSS fragments cache lock, cache reset unsuccessful", e)); //$NON-NLS-1$ } } } @@ -866,7 +866,8 @@ public static String modifyCssStyleSheet(String css, StringBuilder buffer) { try { locked= CSS_FRAGMENTS_CACHE_LOCK.tryLock(100, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { - JavaPlugin.logErrorMessage("Interrupted while waiting for CSS fragments cache lock, proceeding without using cache"); //$NON-NLS-1$ + Thread.currentThread().interrupt(); + return css; } try { if (locked) {