Skip to content

Drop unreachable IOException from CSSEngine String overloads#3976

Merged
vogella merged 2 commits intoeclipse-platform:masterfrom
vogella:css-engine-string-overload-no-ioexception
May 7, 2026
Merged

Drop unreachable IOException from CSSEngine String overloads#3976
vogella merged 2 commits intoeclipse-platform:masterfrom
vogella:css-engine-string-overload-no-ioexception

Conversation

@vogella
Copy link
Copy Markdown
Contributor

@vogella vogella commented May 7, 2026

parseSelectors(String), parsePropertyValue(String), and parseStyleDeclaration(String) wrap the input in a StringReader and delegate to the Reader-based overload. StringReader.read() never throws IOException, but the signature of the Reader overload propagates IOException up from the SAC parser API, so the String forms used to declare a checked exception that could not actually fire. Drop throws IOException from the three String overloads on the internal CSSEngine interface and wrap the inner Reader call in AbstractCSSEngine in try/catch -> IllegalStateException to preserve the impossible case as a defensive guard. Bundle is x-friends so the signature change is internal-only.

vogella and others added 2 commits May 7, 2026 05:54
parseSelectors(String), parsePropertyValue(String), and
parseStyleDeclaration(String) wrap the input in a StringReader and
delegate to the Reader-based overload. StringReader.read() never
throws IOException, but the signature of the Reader overload
propagates IOException up from the SAC parser API, so the String
forms used to declare a checked exception that could not actually
fire. Drop throws IOException from the three String overloads on the
internal CSSEngine interface and wrap the inner Reader call in
AbstractCSSEngine in try/catch -> IllegalStateException to preserve
the impossible case as a defensive guard. Bundle is x-friends so the
signature change is internal-only.
@eclipse-platform-bot
Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From 9c672afcdc0f95efde476e8f468f4f1ec82ec8d5 Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Thu, 7 May 2026 04:00:18 +0000
Subject: [PATCH] Version bump(s) for 4.40 stream


diff --git a/bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF
index 459c82913a..100f3ec52a 100644
--- a/bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.e4.ui.css.core/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-SymbolicName: org.eclipse.e4.ui.css.core;singleton:=true
 Bundle-Name: %pluginName
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
-Bundle-Version: 0.14.600.qualifier
+Bundle-Version: 0.14.700.qualifier
 Export-Package: org.eclipse.e4.ui.css.core;x-internal:=true,
  org.eclipse.e4.ui.css.core.css2;x-friends:="org.eclipse.e4.ui.css.swt.theme,org.eclipse.e4.ui.css.swt,org.eclipse.e4.ui.css.jface",
  org.eclipse.e4.ui.css.core.dom;x-friends:="org.eclipse.e4.ui.css.swt,org.eclipse.ui.views.properties.tabbed,org.eclipse.ui.forms",
-- 
2.53.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Test Results

   852 files  ±0     852 suites  ±0   53m 1s ⏱️ - 4m 26s
 7 954 tests ±0   7 711 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 364 runs  ±0  19 709 ✅ ±0  655 💤 ±0  0 ❌ ±0 

Results for commit 3b795b2. ± Comparison against base commit 7e65263.

@vogella vogella merged commit 8ccf90a into eclipse-platform:master May 7, 2026
18 checks passed
@vogella vogella deleted the css-engine-string-overload-no-ioexception branch May 7, 2026 07:16
@iloveeclipse
Copy link
Copy Markdown
Member

This breaks PDE compile.

Description	Resource	Path	Location	Type
Unreachable catch block for IOException. This exception is never thrown from the try statement body	CssSpyPart.java	/org.eclipse.pde.spy.css/src/org/eclipse/pde/spy/css	line 977	Java Problem

@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented May 7, 2026

I have a look

vogella added a commit to vogella/eclipse.pde that referenced this pull request May 7, 2026
vogella added a commit to eclipse-pde/eclipse.pde that referenced this pull request May 7, 2026
@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented May 7, 2026

This breaks PDE compile.

Description	Resource	Path	Location	Type
Unreachable catch block for IOException. This exception is never thrown from the try statement body	CssSpyPart.java	/org.eclipse.pde.spy.css/src/org/eclipse/pde/spy/css	line 977	Java Problem

Thanks. Fixed with eclipse-pde/eclipse.pde#2327

@vogella
Copy link
Copy Markdown
Contributor Author

vogella commented May 7, 2026

Validated with a local aggregator build containing 8ccf90a and the PDE fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants