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 30, 2023
1 parent 5cb1152 commit d551a60
Show file tree
Hide file tree
Showing 54 changed files with 121 additions and 123 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,9 +16,6 @@

import java.util.Iterator;

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

import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.ui.di.Focus;
Expand Down Expand Up @@ -53,6 +50,9 @@
import org.osgi.framework.BundleException;
import org.osgi.framework.FrameworkUtil;

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

/**
* This class is the main part of the bundle spy. It displays a tableviewer with
* all bundles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
*******************************************************************************/
package org.eclipse.pde.spy.bundle.internal;

import javax.inject.Inject;

import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.pde.spy.bundle.BundleSpyPart;
Expand All @@ -24,6 +22,8 @@
import org.eclipse.swt.widgets.Display;
import org.osgi.framework.Bundle;

import jakarta.inject.Inject;

/**
* The column Label and content Provider used to display information in context
* data TreeViewer. Two instances for label provider are created : one for key,
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,9 +18,6 @@
import java.util.Map;
import java.util.Set;

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

import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Creatable;
import org.eclipse.e4.core.internal.contexts.Computation;
Expand All @@ -30,6 +27,9 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

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

@SuppressWarnings("restriction")
@Creatable
@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
*******************************************************************************/
package org.eclipse.pde.internal.spy.context;

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

import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Optional;
Expand All @@ -39,6 +34,11 @@
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;

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

/**
* This part listen to selection, and if it is an EclipseContext, it displays
* its information It is used in the integrated ContextSpyPart and (in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import java.util.Map;
import java.util.Set;

import javax.inject.Inject;

import org.eclipse.e4.core.internal.contexts.Computation;
import org.eclipse.e4.core.internal.contexts.EclipseContext;
import org.eclipse.jface.resource.FontRegistry;
Expand All @@ -39,6 +37,8 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;

import jakarta.inject.Inject;

/**
* The column Label and content Provider used to display information in context
* data TreeViewer. Two instances for label provider are created : one for key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import java.util.Collections;
import java.util.List;

import javax.inject.Inject;

import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.internal.contexts.EclipseContext;
import org.eclipse.e4.ui.model.application.MApplication;
Expand All @@ -31,6 +29,8 @@
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;

import jakarta.inject.Inject;

@SuppressWarnings("restriction")
/**
* This label and treecontent provider is used by ContextSpyPart to display
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
*******************************************************************************/
package org.eclipse.pde.spy.context;

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

import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.ui.di.Focus;
Expand Down Expand Up @@ -48,6 +44,10 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;

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

/**
* This class is the main part of the context spy. It creates a treeviewer and
* the context data part listening to context selection
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,8 +17,6 @@
import java.text.MessageFormat;
import java.util.List;

import javax.inject.Named;

import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.model.application.MApplication;
Expand All @@ -38,6 +36,8 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;

import jakarta.inject.Named;

public class SpyHandler {
private static final String E4_SPIES_WINDOW = "org.eclipse.pde.spy.core.window";
private static final String E4_SPIES_PART_STACK = "org.eclipse.pde.spy.core.partStack";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import java.util.List;

import javax.inject.Inject;

import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.ILog;
Expand All @@ -42,6 +40,8 @@
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;

import jakarta.inject.Inject;

/** A base class for all spies processors */
public class SpyProcessor {
static final String SPY_TAG = "Spy";
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,9 +18,6 @@
import java.util.HashMap;
import java.util.List;

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

import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.css.core.dom.ExtendedDocumentCSS;
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
Expand All @@ -43,6 +40,9 @@
import org.w3c.dom.stylesheets.StyleSheet;
import org.w3c.dom.stylesheets.StyleSheetList;

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

@SuppressWarnings("restriction")
public class CSSScratchPadPart {
@Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
import java.util.LinkedList;
import java.util.List;

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
Expand Down Expand Up @@ -91,6 +87,10 @@
import org.w3c.dom.css.CSSStyleDeclaration;
import org.w3c.dom.css.CSSValue;

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

@SuppressWarnings("restriction")
public class CssSpyPart {

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,10 +19,6 @@

import java.util.Collection;

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

import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.core.services.events.IEventBroker;
Expand All @@ -39,6 +35,10 @@
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Composite;

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

public class EventSpyPart implements EventMonitor.NewEventListener {

private static final String[] SHOW_FILTER_LINK_TEXT = new String[] { Messages.EventSpyPart_ShowFilters, Messages.EventSpyPart_HideFilters };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
*******************************************************************************/
package org.eclipse.pde.spy.event.internal.util;

import javax.inject.Inject;

import org.eclipse.e4.core.di.annotations.Creatable;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.core.services.log.Logger;
import org.eclipse.pde.spy.event.Constants;

import jakarta.inject.Inject;

@SuppressWarnings("restriction")
@Creatable
public class LoggerWrapper extends Logger {
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,15 +13,15 @@
******************************************************************************/
package org.eclipse.pde.spy.model;

import javax.inject.Inject;

import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.tools.emf.ui.common.IModelResource;
import org.eclipse.e4.tools.emf.ui.internal.wbm.ApplicationModelEditor;
import org.eclipse.e4.ui.di.Focus;
import org.eclipse.e4.ui.model.application.MApplication;

import jakarta.inject.Inject;

@SuppressWarnings("restriction")
public class ModelSpyPart {

Expand Down
Loading

0 comments on commit d551a60

Please sign in to comment.