Skip to content

Commit

Permalink
Migrate PDE from javax.inject/annotation to jakarta.inject/annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Oct 28, 2023
1 parent ca7eed1 commit 9265a3c
Show file tree
Hide file tree
Showing 54 changed files with 100 additions and 102 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ protected boolean isProblem(IReference reference, IProgressMonitor monitor) {
// this is an unexpected condition - the enclosing type is
// visible, but it has no annotations - log an error
String memberName = member.getName();
if (memberName != null) {
if (!memberName.startsWith("javax.")) { //$NON-NLS-1$
ApiPlugin.log(Status.info(MessageFormat.format(BuilderMessages.AbstractTypeLeakDetector_vis_type_has_no_api_description, memberName)));
}
if (memberName != null && !memberName.startsWith("javax.") && !memberName.startsWith("jakarta.")) { //$NON-NLS-1$ //$NON-NLS-2$
ApiPlugin.log(Status.info(MessageFormat.format(
BuilderMessages.AbstractTypeLeakDetector_vis_type_has_no_api_description, memberName)));
}
} else {
// enclosing type is not visible - this is a problem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@ protected boolean isProblem(IReference reference, IProgressMonitor monitor) {
// this is an unexpected condition - the enclosing type is
// visible, but it has no annotations - log an error
String typeName = type.getName();
if (typeName != null) {
if (!typeName.startsWith("javax.")) { //$NON-NLS-1$
ApiPlugin.log(Status.info(MessageFormat.format(BuilderMessages.AbstractTypeLeakDetector_vis_type_has_no_api_description, typeName)));
}
if (typeName != null && !typeName.startsWith("javax.") && !typeName.startsWith("jakarta.")) { //$NON-NLS-1$ //$NON-NLS-2$
ApiPlugin.log(Status.info(MessageFormat.format(
BuilderMessages.AbstractTypeLeakDetector_vis_type_has_no_api_description, typeName)));
}
} else {
// enclosing type is not visible - this is a problem
Expand Down
6 changes: 3 additions & 3 deletions ui/org.eclipse.pde.spy.bundle/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %name
Bundle-SymbolicName: org.eclipse.pde.spy.bundle;singleton:=true
Bundle-Version: 0.13.100.qualifier
Bundle-Version: 0.13.200.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: org.eclipse.pde.spy.bundle
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.29.0",
Expand All @@ -11,7 +11,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.29.0",
org.eclipse.e4.core.di,
org.eclipse.e4.ui.di
Bundle-Localization: plugin
Import-Package: javax.annotation;version="[1.3.0,2.0.0)",
javax.inject;version="[1.0.0,2.0.0)"
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)",
jakarta.inject;version="[2.0.0,3.0.0)"
Bundle-Vendor: %provider-name
Bundle-ActivationPolicy: lazy
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import java.util.Iterator;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import jakarta.annotation.PostConstruct;
import jakarta.inject.Inject;

import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*******************************************************************************/
package org.eclipse.pde.spy.bundle.internal;

import javax.inject.Inject;
import jakarta.inject.Inject;

import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.ColumnLabelProvider;
Expand Down
6 changes: 3 additions & 3 deletions ui/org.eclipse.pde.spy.context/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %name
Bundle-SymbolicName: org.eclipse.pde.spy.context;singleton:=true
Bundle-Version: 1.1.100.qualifier
Bundle-Version: 1.1.200.qualifier
Bundle-Vendor: %provider-name
Automatic-Module-Name: org.eclipse.pde.spy.context
Bundle-RequiredExecutionEnvironment: JavaSE-17
Expand All @@ -17,8 +17,8 @@ Require-Bundle: org.eclipse.jface;bundle-version="3.9.0",
org.eclipse.e4.core.services;bundle-version="1.1.0",
org.eclipse.pde.spy.core;bundle-version="1.0.100"
Bundle-ActivationPolicy: lazy
Import-Package: javax.annotation;version="[1.2.0,2.0.0)",
javax.inject;version="[1.0.0,2.0.0)"
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)",
jakarta.inject;version="[2.0.0,3.0.0)"
Bundle-Localization: plugin
Export-Package: org.eclipse.pde.spy.context

Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import java.util.Map;
import java.util.Set;

import javax.inject.Inject;
import javax.inject.Singleton;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;

import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Creatable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
*******************************************************************************/
package org.eclipse.pde.internal.spy.context;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
import javax.inject.Named;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import jakarta.inject.Inject;
import jakarta.inject.Named;

import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Map;
import java.util.Set;

import javax.inject.Inject;
import jakarta.inject.Inject;

import org.eclipse.e4.core.internal.contexts.Computation;
import org.eclipse.e4.core.internal.contexts.EclipseContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import java.util.Collections;
import java.util.List;

import javax.inject.Inject;
import jakarta.inject.Inject;

import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.internal.contexts.EclipseContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
*******************************************************************************/
package org.eclipse.pde.spy.context;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import jakarta.inject.Inject;

import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
Expand Down
4 changes: 2 additions & 2 deletions ui/org.eclipse.pde.spy.core/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %name
Bundle-SymbolicName: org.eclipse.pde.spy.core;singleton:=true
Bundle-Version: 1.1.100.qualifier
Bundle-Version: 1.1.200.qualifier
Automatic-Module-Name: org.eclipse.pde.spy.core
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-17
Expand All @@ -12,6 +12,6 @@ Require-Bundle: org.eclipse.e4.ui.model.workbench,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.ui.di,
org.eclipse.emf.ecore
Import-Package: javax.inject;version="[1.0.0,2.0.0)",
Import-Package: jakarta.inject;version="[2.0.0,3.0.0)",
org.eclipse.emf.ecore
Bundle-Vendor: %provider-name
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.text.MessageFormat;
import java.util.List;

import javax.inject.Named;
import jakarta.inject.Named;

import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.di.annotations.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import java.util.List;

import javax.inject.Inject;
import jakarta.inject.Inject;

import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
Expand Down
4 changes: 2 additions & 2 deletions ui/org.eclipse.pde.spy.css/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.29.0",
org.eclipse.e4.ui.model.workbench;bundle-version="0.9.1",
org.eclipse.pde.spy.core;bundle-version="1.0.200"
Bundle-ActivationPolicy: lazy
Import-Package: javax.annotation;version="[1.2.0,2.0.0)",
javax.inject;version="[1.0.0,2.0.0)",
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)",
jakarta.inject;version="[2.0.0,3.0.0)",
org.eclipse.e4.core.contexts,
org.eclipse.e4.core.di.annotations,
org.eclipse.e4.ui.services,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import java.util.HashMap;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import jakarta.annotation.PostConstruct;
import jakarta.inject.Inject;

import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.css.core.dom.ExtendedDocumentCSS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import java.util.LinkedList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;
import jakarta.annotation.PostConstruct;
import jakarta.inject.Inject;
import jakarta.inject.Named;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
Expand Down
4 changes: 2 additions & 2 deletions ui/org.eclipse.pde.spy.event/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.databinding.property;bundle-version="1.9.0"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Import-Package: javax.annotation;version="[1.2.0,2.0.0)",
javax.inject;version="[1.0.0,2.0.0)",
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)",
jakarta.inject;version="[2.0.0,3.0.0)",
org.osgi.service.event;version="[1.4.0,2.0.0)"
Bundle-Localization: plugin
Export-Package: org.eclipse.pde.spy.event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

import java.util.Collection;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import jakarta.inject.Inject;

import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*******************************************************************************/
package org.eclipse.pde.spy.event.internal.util;

import javax.inject.Inject;
import jakarta.inject.Inject;

import org.eclipse.e4.core.di.annotations.Creatable;
import org.eclipse.e4.core.di.annotations.Optional;
Expand Down
2 changes: 1 addition & 1 deletion ui/org.eclipse.pde.spy.model/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ Bundle-Localization: plugin
Bundle-Vendor: %provider-name
Service-Component: OSGI-INF/extensionlookup.xml
Bundle-ActivationPolicy: lazy
Import-Package: javax.inject;version="[1.0.0,2.0.0)"
Import-Package: jakarta.inject;version="[2.0.0,3.0.0)"
Export-Package: org.eclipse.pde.spy.model;x-internal:=true
Automatic-Module-Name: org.eclipse.pde.spy.model
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
******************************************************************************/
package org.eclipse.pde.spy.model;

import javax.inject.Inject;
import jakarta.inject.Inject;

import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
******************************************************************************/
package org.eclipse.pde.spy.model;

import javax.inject.Named;
import jakarta.inject.Named;

import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
Expand Down
4 changes: 2 additions & 2 deletions ui/org.eclipse.pde.spy.preferences/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.core.runtime,
org.eclipse.e4.ui.dialogs;bundle-version="1.3.0",
org.eclipse.jface;bundle-version="3.24.0"
Import-Package: javax.annotation;version="[1.3.0,2.0.0)",
javax.inject;version="[1.0.0,2.0.0)"
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)",
jakarta.inject;version="[2.0.0,3.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*******************************************************************************/
package org.eclipse.pde.spy.preferences.addon;

import javax.inject.Inject;
import jakarta.inject.Inject;

import org.eclipse.core.internal.preferences.EclipsePreferences;
import org.eclipse.core.runtime.preferences.BundleDefaultsScope;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import java.util.List;

import javax.inject.Named;
import jakarta.inject.Named;

import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.di.annotations.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import java.util.List;

import javax.inject.Named;
import jakarta.inject.Named;

import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.di.annotations.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

import java.net.URL;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import jakarta.inject.Inject;

import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

import static org.eclipse.pde.spy.preferences.handler.ToggleLayoutControl.getImageDescriptor;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
import jakarta.annotation.PostConstruct;
import jakarta.annotation.PreDestroy;
import jakarta.inject.Inject;

import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.e4.core.di.extensions.Preference;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import java.util.Collection;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import jakarta.annotation.PostConstruct;
import jakarta.inject.Inject;

import org.eclipse.core.databinding.beans.typed.BeanProperties;
import org.eclipse.core.databinding.observable.Realm;
Expand Down
2 changes: 1 addition & 1 deletion ui/org.eclipse.pde.ui.templates/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Export-Package: org.eclipse.pde.internal.ui.templates;x-internal:=true,
org.eclipse.pde.internal.ui.templates.ide;x-internal:=true,
org.eclipse.pde.internal.ui.templates.osgi;x-internal:=true,
org.eclipse.pde.internal.ui.templates.rcp;x-internal:=true
Import-Package: javax.annotation;version="[1.3.0,2.0.0)"
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)"
Require-Bundle: org.eclipse.ui;bundle-version="[3.3.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
org.eclipse.pde.ui;bundle-version="[3.3.0,4.0.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
public class E4ApplicationNewWizard extends AbstractE4NewPluginTemplateWizard {

private static final List<String> PACKAGE_IMPORTS = List.of( //
"javax.annotation;version=\"[1.2.0,2.0.0)\"", //$NON-NLS-1$
"javax.inject;version=\"[1.0.0,2.0.0)\""); //$NON-NLS-1$
"jakarta.annotation;version=\"[2.1.0,3.0.0)\"", //$NON-NLS-1$
"jakarta.inject;version=\"[2.0.0,3.0.0)\""); //$NON-NLS-1$

@Override
public void init(IFieldData data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
public class E4HandlerNewWizard extends AbstractE4NewPluginTemplateWizard {

private static final List<String> PACKAGE_IMPORTS = List.of( //
"javax.annotation;version=\"[1.2.0,2.0.0)\"", //$NON-NLS-1$
"javax.inject;version=\"[1.0.0,2.0.0)\"", //$NON-NLS-1$
"jakarta.annotation;version=\"[2.1.0,3.0.0)\"", //$NON-NLS-1$
"jakarta.inject;version=\"[2.0.0,3.0.0)\"", //$NON-NLS-1$
"org.osgi.framework;version=\"[1.10.0,2.0.0)\""); //$NON-NLS-1$

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
public class E4ToolbarContributionNewWizard extends AbstractE4NewPluginTemplateWizard {

private static final List<String> PACKAGE_IMPORTS = List.of( //
"javax.annotation;version=\"[1.2.0,2.0.0)\"", //$NON-NLS-1$
"javax.inject;version=\"[1.0.0,2.0.0)\"", //$NON-NLS-1$
"jakarta.annotation;version=\"[2.1.0,3.0.0)\"", //$NON-NLS-1$
"jakarta.inject;version=\"[2.0.0,3.0.0)\"", //$NON-NLS-1$
"org.osgi.framework;version=\"[1.10.0,2.0.0)\""); //$NON-NLS-1$

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
public class E4ViewNewWizard extends AbstractE4NewPluginTemplateWizard {

private static final List<String> PACKAGE_IMPORTS = List.of( //
"javax.annotation;version=\"[1.2.0,2.0.0)\"", //$NON-NLS-1$
"javax.inject;version=\"[1.0.0,2.0.0)\"", //$NON-NLS-1$
"jakarta.annotation;version=\"[2.1.0,3.0.0)\"", //$NON-NLS-1$
"jakarta.inject;version=\"[2.0.0,3.0.0)\"", //$NON-NLS-1$
"org.osgi.framework;version=\"[1.10.0,2.0.0)\""); //$NON-NLS-1$

@Override
Expand Down
Loading

0 comments on commit 9265a3c

Please sign in to comment.