Skip to content

Clean Code for bundles/org.eclipse.osgi#796

Open
eclipse-equinox-bot wants to merge 1 commit intomasterfrom
clean-code/bundles/org.eclipse.osgi
Open

Clean Code for bundles/org.eclipse.osgi#796
eclipse-equinox-bot wants to merge 1 commit intomasterfrom
clean-code/bundles/org.eclipse.osgi

Conversation

@eclipse-equinox-bot
Copy link
Contributor

@eclipse-equinox-bot eclipse-equinox-bot commented Jan 27, 2025

The following cleanups were applied:

  • Add final modifier to private fields
  • Add missing '@Deprecated' annotations
  • Add missing '@Override' annotations
  • Add missing '@Override' annotations to implementations of interface methods
  • Convert control statement bodies to block
  • Make inner classes static where possible
  • Remove trailing white spaces on all lines
  • Remove unnecessary array creation for varargs
  • Remove unnecessary suppress warning tokens
  • Remove unused imports
  • Remove unused private constructors
  • Remove unused private fields
  • Remove unused private methods
  • Remove unused private types
  • Replace deprecated calls with inlined content where possible
  • Use pattern matching for instanceof

The following Manifest cleanups where applied:

  • Calculate 'uses' directive for public packages
  • Remove unused dependencies

@github-actions
Copy link

github-actions bot commented Jan 27, 2025

Test Results

  846 files  ±0    846 suites  ±0   1h 45m 50s ⏱️ - 2m 16s
2 234 tests ±0  2 185 ✅ ±0   49 💤 ±0  0 ❌ ±0 
6 702 runs  ±0  6 553 ✅ ±0  149 💤 ±0  0 ❌ ±0 

Results for commit 4493fb6. ± Comparison against base commit d45517b.

♻️ This comment has been updated with latest results.

Copy link
Member

@laeubi laeubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup produces a compile error, need to investigate.

@laeubi
Copy link
Member

laeubi commented Jan 27, 2025

I think this is similar to

I need to adjust Tycho to pass in the configured toolchain JDKs so we get a real java 8 JVM most likely.

@laeubi laeubi marked this pull request as draft January 27, 2025 11:48
@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch from 3779d22 to 48abd4a Compare January 28, 2025 03:36
@laeubi
Copy link
Member

laeubi commented Jan 28, 2025

@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch 2 times, most recently from 62d8981 to 1bbcc81 Compare January 30, 2025 03:33
@laeubi
Copy link
Member

laeubi commented Jan 30, 2025

@tjwatson this also cleanups the felix embedded code, we actually have two options here I think

  1. I implement some kind of exclusion rules in tycho so we can skip some source path
  2. We apply them as is to the codebase

@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch from 1bbcc81 to 657162c Compare January 30, 2025 08:16
@laeubi laeubi marked this pull request as ready for review January 30, 2025 10:32
Copy link
Member

@laeubi laeubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also working here now, but waiting for feedback from @tjwatson

Copy link
Contributor

@tjwatson tjwatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to org.eclipse packages look fine. We should not change anything to org.osgi or org.apache source. That should be done in the respective projects. Especially for the org.osgi APIs

@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch 3 times, most recently from 0ba013e to 8855a87 Compare February 6, 2025 03:36
@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch 2 times, most recently from 11f980f to f0b3ccb Compare February 14, 2025 03:25
@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch 3 times, most recently from fc3d7e0 to 8342deb Compare March 5, 2025 03:31
@eclipse-equinox-bot
Copy link
Contributor Author

eclipse-equinox-bot commented Mar 5, 2025

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.osgi/META-INF/MANIFEST.MF
bundles/org.eclipse.osgi/pom.xml
bundles/org.eclipse.osgi/supplement/META-INF/MANIFEST.MF
features/org.eclipse.equinox.core.feature/feature.xml
features/org.eclipse.equinox.core.sdk/feature.xml
features/org.eclipse.equinox.server.core/feature.xml

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 67eaa960754966edeca835eb939105bc2f184955 Mon Sep 17 00:00:00 2001
From: Eclipse Equinox Bot <equinox-bot@eclipse.org>
Date: Thu, 11 Dec 2025 04:56:49 +0000
Subject: [PATCH] Version bump(s) for 4.39 stream


diff --git a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
index 880e2026d..9ba367a4b 100644
--- a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
@@ -105,7 +105,7 @@ Bundle-Activator: org.eclipse.osgi.internal.framework.SystemBundleActivator
 Bundle-Description: %systemBundle
 Bundle-Copyright: %copyright
 Bundle-Vendor: %eclipse.org
-Bundle-Version: 3.24.0.qualifier
+Bundle-Version: 3.24.100.qualifier
 Bundle-Localization: systembundle
 Bundle-DocUrl: http://www.eclipse.org
 Eclipse-ExtensibleAPI: true
diff --git a/bundles/org.eclipse.osgi/pom.xml b/bundles/org.eclipse.osgi/pom.xml
index b4c16dd2e..8f541ae81 100644
--- a/bundles/org.eclipse.osgi/pom.xml
+++ b/bundles/org.eclipse.osgi/pom.xml
@@ -19,7 +19,7 @@
 </parent>
   <groupId>org.eclipse.platform</groupId>
   <artifactId>org.eclipse.osgi</artifactId>
-  <version>3.24.0-SNAPSHOT</version>
+  <version>3.24.100-SNAPSHOT</version>
   <packaging>eclipse-plugin</packaging>
   <properties>
 	  <!-- The actual TCKs are executed in the org.eclipse.osgi.tck module because of reference to other service implementations -->
diff --git a/bundles/org.eclipse.osgi/supplement/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi/supplement/META-INF/MANIFEST.MF
index 89e8ef752..57c7ca029 100644
--- a/bundles/org.eclipse.osgi/supplement/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.osgi/supplement/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.equinox.supplement
-Bundle-Version: 1.12.100.qualifier
+Bundle-Version: 1.12.200.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: org.eclipse.equinox.log;version="1.1",
diff --git a/features/org.eclipse.equinox.core.feature/feature.xml b/features/org.eclipse.equinox.core.feature/feature.xml
index c9d008726..aaf1c5edf 100644
--- a/features/org.eclipse.equinox.core.feature/feature.xml
+++ b/features/org.eclipse.equinox.core.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.equinox.core.feature"
       label="%featureName"
-      version="1.15.700.qualifier"
+      version="1.15.800.qualifier"
       provider-name="%providerName"
       license-feature="org.eclipse.license"
       license-feature-version="0.0.0">
diff --git a/features/org.eclipse.equinox.core.sdk/feature.xml b/features/org.eclipse.equinox.core.sdk/feature.xml
index e719b10b1..1e7c3fd5b 100644
--- a/features/org.eclipse.equinox.core.sdk/feature.xml
+++ b/features/org.eclipse.equinox.core.sdk/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.equinox.core.sdk"
       label="%featureName"
-      version="3.25.700.qualifier"
+      version="3.25.800.qualifier"
       provider-name="%providerName"
       license-feature="org.eclipse.license"
       license-feature-version="0.0.0">
diff --git a/features/org.eclipse.equinox.server.core/feature.xml b/features/org.eclipse.equinox.server.core/feature.xml
index 7b0fb3a4d..b36e7df70 100644
--- a/features/org.eclipse.equinox.server.core/feature.xml
+++ b/features/org.eclipse.equinox.server.core/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.equinox.server.core"
       label="%featureName"
-      version="1.16.700.qualifier"
+      version="1.16.800.qualifier"
       provider-name="%providerName"
       license-feature="org.eclipse.license"
       license-feature-version="0.0.0">
-- 
2.52.0

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

@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch from 963bf48 to 3906bc9 Compare March 5, 2025 06:26
@laeubi
Copy link
Member

laeubi commented Mar 5, 2025

@tjwatson I now added the excludes, the rest looks fine for me, could you probably also review and approve?

@laeubi laeubi requested a review from tjwatson March 5, 2025 07:24
@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch 5 times, most recently from fd94d85 to 7f36c31 Compare March 9, 2025 03:33
@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch 8 times, most recently from 66ea89f to 694306a Compare September 2, 2025 04:12
@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch from 982c30e to 38eb76a Compare September 3, 2025 04:13
@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch 2 times, most recently from 0e31fec to 85a9e0c Compare November 12, 2025 04:38
Copy link
Contributor

@tjwatson tjwatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only got about 25% through this PR files. It is a lot. Instead of putting it down to complete later I'm just submitting my findings so far.

if (log != null) {
log.log(logEntry);
else
} else { // TODO desperate measure - ideally, we should write this to disk (a la // Main.log)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something odd happened with this cleanup that makes this comment appear twice now.

if (log != null) {
log.log(logEntry);
else
} else { // TODO desperate measure - ideally, we should write this to disk (a la // Main.log)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue with duplicate comment.

if (candidateName.length() == 4 + target.length() && candidateName.endsWith(".jar")) { //$NON-NLS-1$
simpleJar = true;
else
} else { // name does not match the target properly with an (_|-) version at the end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate comment, but maybe the same issue as @laeubi points out with issue eclipse-jdt/eclipse.jdt.ui#2067

result[i] = Integer.valueOf(token);
} catch (Exception e) {
if (i == 0)
if (i == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange that the cleanup worked correctly on this comment

device = original.substring(0, uncPrefixEnd);
original = original.substring(uncPrefixEnd, original.length());
} else
} else { // not a valid UNC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double comment

@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch 3 times, most recently from b2a4a38 to 75c32d3 Compare November 15, 2025 04:38
@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch 8 times, most recently from 351a799 to 2a86f77 Compare December 8, 2025 04:44
@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch 5 times, most recently from 57a6f30 to 66853d3 Compare December 13, 2025 04:26
@eclipse-equinox-bot eclipse-equinox-bot force-pushed the clean-code/bundles/org.eclipse.osgi branch from 66853d3 to 4493fb6 Compare December 16, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants